]> pd.if.org Git - nbds/blobdiff - runtime/runtime.c
improve memory allocator
[nbds] / runtime / runtime.c
index c41a1bdaa895364ee9440286de33315c31dacc98..b145faa872e5826ed70a979d724a561cdc24738a 100644 (file)
@@ -2,10 +2,12 @@
  * Written by Josh Dybnis and released to the public domain, as explained at
  * http://creativecommons.org/licenses/publicdomain
  */
+#define _POSIX_C_SOURCE 1 // for rand_r()
+#include <stdlib.h>
 #include <pthread.h>
 #include "common.h"
 #include "runtime.h"
-#include "runtime_local.h"
+#include "rlocal.h"
 #include "mem.h"
 #include "tls.h"
 
@@ -18,12 +20,11 @@ typedef struct thread_info {
     void *restrict arg;
 } thread_info_t;
 
-void nbd_init (void) {
-    sranddev();
+__attribute__ ((constructor(102))) void nbd_init (void) {
+    //sranddev();
     INIT_THREAD_LOCAL(rand_seed_);
     INIT_THREAD_LOCAL(tid_);
     SET_THREAD_LOCAL(tid_, 0);
-    mem_init();
     lwt_thread_init(0);
     rcu_thread_init(0);
 }