X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Robust%2Fsrc%2FRuntime%2FDSTM%2Finterface%2Fobjstr.c;h=b3d2cbdd577721b43563ad3786748e3a38dec193;hb=cdcf09c40af1419fa42932aae249cb79b69b5daf;hp=4a66fa54565f9e81d87e310c58395f4dd6aec7a6;hpb=31d3823e372b72716c243fac343d50cd62f7b092;p=IRC.git diff --git a/Robust/src/Runtime/DSTM/interface/objstr.c b/Robust/src/Runtime/DSTM/interface/objstr.c deleted file mode 100644 index 4a66fa54..00000000 --- a/Robust/src/Runtime/DSTM/interface/objstr.c +++ /dev/null @@ -1,57 +0,0 @@ -#include "dstm.h" - -objstr_t *objstrCreate(unsigned int size) -{ - objstr_t *tmp = malloc(sizeof(objstr_t) + size); - tmp->size = size; - tmp->top = tmp + 1; //points to end of objstr_t structure! - return tmp; -} - -//free entire list, starting at store -void objstrDelete(objstr_t *store) -{ - objstr_t *tmp; - while (store != NULL) - { - tmp = store->next; - free(store); - store = tmp; - } - return; -} - -void *objstrAlloc(objstr_t *store, unsigned int size) -{ - void *tmp; - while (1) - { - if (((unsigned int)store->top - (unsigned int)store - sizeof(objstr_t) + size) <= store->size) - { //store not full - tmp = store->top; - store->top += size; - return tmp; - } - //store full - if (store->next == NULL) - { //end of list, all full - if (size > DEFAULT_OBJ_STORE_SIZE) //in case of large objects - { - store->next = (objstr_t *)malloc(sizeof(objstr_t) + size); - store = store->next; - store->size = size; - } - else - { - store->next = malloc(sizeof(objstr_t) + DEFAULT_OBJ_STORE_SIZE); - store = store->next; - store->size = DEFAULT_OBJ_STORE_SIZE; - } - store->top = (void *)((unsigned int)store + sizeof(objstr_t) + size); - return (void *)((unsigned int)store + sizeof(objstr_t)); - } - else //try the next one - store = store->next; - } -} -