5 #include "runtime_arch.h"
8 #include "bambooalign.h"
10 extern volatile bool gcflag;
11 void * mycalloc_share(struct garbagelist * stackptr, int size) {
13 int isize = ((size-1)&(~(ALIGNMENTSIZE-1)))+ALIGNMENTSIZE;
20 p = BAMBOO_SHARE_MEM_CALLOC(isize); // calloc(m, isize);
23 // no more global shared memory
31 // no more global shared memory
41 void * mycalloc_share(int size) {
42 int isize = ((size-1)&(~(BAMBOO_CACHE_LINE_MASK)))+(BAMBOO_CACHE_LINE_SIZE);
43 void * p = BAMBOO_SHARE_MEM_CALLOC(isize); // calloc(m, isize);
45 // no more global shared memory
48 return (void *)(BAMBOO_CACHE_LINE_SIZE+((int)p-1)&(~BAMBOO_CACHE_LINE_MASK));
52 void * mycalloc(int size, char * file, int line) {
53 BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
54 void * p = mycalloc_i(size, file, line);
55 BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
60 void * mycalloc_i(int size, char * file, int line) {
61 void * p = BAMBOO_LOCAL_MEM_CALLOC(size);
63 tprintf("mycalloc_i %s %d \n", file, line);
69 void myfree(void * ptr) {
70 BAMBOO_ENTER_RUNTIME_MODE_FROM_CLIENT();
71 BAMBOO_LOCAL_MEM_FREE(ptr);
72 BAMBOO_ENTER_CLIENT_MODE_FROM_RUNTIME();
76 void myfree_i(void * ptr) {
77 BAMBOO_LOCAL_MEM_FREE(ptr);