]> jfr.im git - irc/atheme/libmowgli-2.git/commitdiff
container/index: initialise index_heap at load time
authorAaron Jones <redacted>
Fri, 18 Jan 2019 03:28:23 +0000 (03:28 +0000)
committerAaron Jones <redacted>
Fri, 18 Jan 2019 03:28:23 +0000 (03:28 +0000)
Fixes compiler diagnostic:

index.c:34:1: warning: no previous prototype for function
    'mowgli_index_init' [-Wmissing-prototypes]

src/libmowgli/container/index.c
src/libmowgli/core/bootstrap.c
src/libmowgli/core/bootstrap_internal.h

index ed2dc8ddbf36c30d74887a783f4ba6bf397d8606..646c962aa4e4593382d8f44a42d50c7f2dda49eb 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "mowgli.h"
+#include "core/bootstrap_internal.h"
 
 struct mowgli_index_
 {
@@ -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 *
index add6cd871ef82697f50a48ecbc2922b4ae15b2b3..f57168b0a8100011f9adf9f36d34d7fb0cac55ca 100644 (file)
@@ -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();
index 462f501a5a06d16286165c5f3a70c88e521445ca..6f9ef2da0af8299bb6fa38ec485d13da7cc3f51c 100644 (file)
@@ -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);