Skip to content

Commit

Permalink
container/index: initialise index_heap at load time
Browse files Browse the repository at this point in the history
Fixes compiler diagnostic:

index.c:34:1: warning: no previous prototype for function
    'mowgli_index_init' [-Wmissing-prototypes]
  • Loading branch information
aaronmdjones committed Jan 18, 2019
1 parent 1bac5e4 commit 4038700
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/libmowgli/container/index.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/

#include "mowgli.h"
#include "core/bootstrap_internal.h"

struct mowgli_index_
{
Expand All @@ -31,9 +32,10 @@ struct mowgli_index_
static mowgli_heap_t *index_heap = NULL;

void
mowgli_index_init(void)
mowgli_index_bootstrap(void)
{
index_heap = mowgli_heap_create(sizeof(mowgli_index_t), 32, BH_NOW);
if (! (index_heap = mowgli_heap_create(sizeof(mowgli_index_t), 32, BH_NOW)))
abort();
}

mowgli_index_t *
Expand Down
1 change: 1 addition & 0 deletions src/libmowgli/core/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ MOWGLI_BOOTSTRAP_FUNC(mowgli_bootstrap_real)
mowgli_memslice_bootstrap();
mowgli_cacheline_bootstrap();
mowgli_interface_bootstrap();
mowgli_index_bootstrap();

#ifdef _WIN32
mowgli_winsock_bootstrap();
Expand Down
1 change: 1 addition & 0 deletions src/libmowgli/core/bootstrap_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ extern void mowgli_node_bootstrap(void);
extern void mowgli_object_class_bootstrap(void);
extern void mowgli_queue_bootstrap(void);
extern void mowgli_random_bootstrap(void);
extern void mowgli_index_bootstrap(void);

#ifdef _WIN32
extern void mowgli_winsock_bootstrap(void);
Expand Down

0 comments on commit 4038700

Please sign in to comment.