Browse code

core: share memory initialization updated for new memory management api

Daniel-Constantin Mierla authored on 14/09/2015 07:29:50
Showing 2 changed files
... ...
@@ -22,11 +22,19 @@
22 22
  */
23 23
 
24 24
 #include "shm_init.h"
25
-#include "mem/mem.h"
25
+#include "mem/shm.h"
26 26
 #include "globals.h"
27 27
 
28 28
 static int shm_init = 0;
29
+static char *shm_mname = 0;
29 30
 
31
+/**
32
+ *
33
+ */
34
+void shm_set_mname(char *mname)
35
+{
36
+	shm_mname = mname;
37
+}
30 38
 
31 39
 /** check if shm is initialized.
32 40
  * @return 1 if initialized, 0 if not
... ...
@@ -62,9 +70,7 @@ int init_shm()
62 62
 			goto error;
63 63
 		}
64 64
 	}
65
-	if (shm_mem_size == 0)
66
-		shm_mem_size=SHM_MEM_SIZE * 1024 * 1024;
67
-	if (init_shm_mallocs(shm_force_alloc)==-1)
65
+	if (shm_init_manager(shm_mname)<0)
68 66
 		goto error;
69 67
 	shm_init=1;
70 68
 	return 0;
... ...
@@ -26,6 +26,7 @@
26 26
 
27 27
 int shm_initialized(void);
28 28
 int init_shm(void);
29
+void shm_set_mname(char *mname);
29 30
 
30 31
 #endif /*__shm_init_h*/
31 32