Module: kamailio
Branch: master
Commit: 0987dc72474aea838592341e661b86cadad5a57b
URL:
https://github.com/kamailio/kamailio/commit/0987dc72474aea838592341e661b86c…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-09-14T10:22:45+02:00
core: share memory initialization updated for new memory management api
---
Modified: shm_init.c
Modified: shm_init.h
---
Diff:
https://github.com/kamailio/kamailio/commit/0987dc72474aea838592341e661b86c…
Patch:
https://github.com/kamailio/kamailio/commit/0987dc72474aea838592341e661b86c…
---
diff --git a/shm_init.c b/shm_init.c
index 19e6117..a02eb04 100644
--- a/shm_init.c
+++ b/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;
diff --git a/shm_init.h b/shm_init.h
index 60b233f..178800b 100644
--- a/shm_init.h
+++ b/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*/