5 #include "runtime_arch.h"
8 #include "bambooalign.h"
9 #include "multicoremem.h"
10 #include "multicoregarbage.h"
13 extern volatile bool gcflag;
14 void * mycalloc_share(struct garbagelist * stackptr, int size) {
16 int isize = ((size-1)&(~(ALIGNMENTSIZE-1)))+ALIGNMENTSIZE;
23 p = BAMBOO_SHARE_MEM_CALLOC(isize); // calloc(m, isize);
26 // no more global shared memory
34 // no more global shared memory
44 void * mycalloc_share(int size) {
45 int isize = ((size-1)&(~(BAMBOO_CACHE_LINE_MASK)))+(BAMBOO_CACHE_LINE_SIZE);
46 void * p = BAMBOO_SHARE_MEM_CALLOC(isize); // calloc(m, isize);
48 // no more global shared memory
51 return (void *)(BAMBOO_CACHE_LINE_SIZE+((int)p-1)&(~BAMBOO_CACHE_LINE_MASK));
55 void * mycalloc(int size, char * file, int line) {
56 BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
57 void * p = mycalloc_i(size, file, line);
58 BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
63 void * mycalloc_i(int size, char * file, int line) {
64 void * p = BAMBOO_LOCAL_MEM_CALLOC(size);
66 tprintf("mycalloc_i %s %d \n", file, line);
72 void myfree(void * ptr) {
73 BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
74 BAMBOO_LOCAL_MEM_FREE(ptr);
75 BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
79 void myfree_i(void * ptr) {
80 BAMBOO_LOCAL_MEM_FREE(ptr);