Browse Source

core: share memory initialization updated for new memory management api

Daniel-Constantin Mierla 10 years ago
parent
commit
0987dc7247
2 changed files with 11 additions and 4 deletions
  1. 10 4
      shm_init.c
  2. 1 0
      shm_init.h

+ 10 - 4
shm_init.c

@@ -22,11 +22,19 @@
  */
 
 #include "shm_init.h"
-#include "mem/mem.h"
+#include "mem/shm.h"
 #include "globals.h"
 
 static int shm_init = 0;
+static char *shm_mname = 0;
 
+/**
+ *
+ */
+void shm_set_mname(char *mname)
+{
+	shm_mname = mname;
+}
 
 /** check if shm is initialized.
  * @return 1 if initialized, 0 if not
@@ -62,9 +70,7 @@ int init_shm()
 			goto error;
 		}
 	}
-	if (shm_mem_size == 0)
-		shm_mem_size=SHM_MEM_SIZE * 1024 * 1024;
-	if (init_shm_mallocs(shm_force_alloc)==-1)
+	if (shm_init_manager(shm_mname)<0)
 		goto error;
 	shm_init=1;
 	return 0;

+ 1 - 0
shm_init.h

@@ -26,6 +26,7 @@
 
 int shm_initialized(void);
 int init_shm(void);
+void shm_set_mname(char *mname);
 
 #endif /*__shm_init_h*/