Minor changes. Does not actually affect the outcome.
This commit is contained in:
3 files changed
+8
-8
No files matched your search
+2
-4
@@ -23,18 +23,17 @@ void node_pool_init(int32_t max_nodes) {
|
||||
pool = malloc(pool_capacity * sizeof(Node));
|
||||
visited_pool = malloc(pool_capacity * sizeof(VisitedEntry));
|
||||
if (!pool || !visited_pool) {
|
||||
fprintf(stderr, "Fatal: Could not allocate Node Pool for %d nodes.\n", max_nodes);
|
||||
fprintf(stderr, "Fatal: Could not allocate Node Pool for %i nodes.\n", max_nodes);
|
||||
exit(1);
|
||||
}
|
||||
pool_ptr = 0;
|
||||
visited_ptr = 0;
|
||||
for (size_t i = 0; i < HASH_SIZE; ++i) hash_table[i] = NULL;
|
||||
queue_init(max_nodes);
|
||||
}
|
||||
|
||||
Node* node_pool_alloc() {
|
||||
if (pool_ptr >= pool_capacity) {
|
||||
fprintf(stderr, "\nNode Pool Overflow! Need more than %d nodes.\n", pool_capacity);
|
||||
fprintf(stderr, "\nNode Pool Overflow! Need more than %i nodes.\n", pool_capacity);
|
||||
return NULL;
|
||||
}
|
||||
return &pool[pool_ptr++];
|
||||
@@ -46,7 +45,6 @@ void node_pool_reset() {
|
||||
|
||||
void node_pool_destroy() {
|
||||
if (pool) free(pool);
|
||||
queue_destroy();
|
||||
}
|
||||
|
||||
int32_t node_pool_usage() {
|
||||
|
||||
Reference in new issue
Block a user