Skip to content

Commit

Permalink
core: share memory initialization updated for new memory management api
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Sep 14, 2015
1 parent faa5086 commit 0987dc7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions shm_init.c
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions shm_init.h
Expand Up @@ -26,6 +26,7 @@

int shm_initialized(void);
int init_shm(void);
void shm_set_mname(char *mname);

#endif /*__shm_init_h*/

Expand Down

0 comments on commit 0987dc7

Please sign in to comment.