diff vmalloc.h @ 66:bf08108405cc

Added recycle pool -- will merge later -- need to get PLDI results for now
author Me
date Mon, 15 Nov 2010 12:11:24 -0800
parents 13b22ffb8a2f
children
line diff
     1.1 --- a/vmalloc.h	Sun Nov 14 11:17:52 2010 -0800
     1.2 +++ b/vmalloc.h	Mon Nov 15 12:11:24 2010 -0800
     1.3 @@ -31,6 +31,19 @@
     1.4   }
     1.5  FreeListHead;
     1.6  
     1.7 +typedef struct
     1.8 + {
     1.9 +  int32  hasNewStructs;
    1.10 +  int32  sizeOfStructs;
    1.11 +  int32  currArraySize;
    1.12 +  void **arrays;
    1.13 +  PrivDynArrayInfo *arraysInfo;
    1.14 +  char  *ptrToNextStruct;
    1.15 +  char  *ptrToTopOfCurrArray;
    1.16 +  PrivQueueStruc *recycleQ;
    1.17 + }
    1.18 +VMSRecyclePool;
    1.19 +
    1.20  void *
    1.21  VMS__malloc( int32 sizeRequested );
    1.22  
    1.23 @@ -54,4 +67,18 @@
    1.24  void
    1.25  VMS_ext__free_free_list( MallocProlog *freeListHead );
    1.26  
    1.27 +//==========================================================================
    1.28 +
    1.29 +VMSRecyclePool *
    1.30 +VMS__make_recycle_pool( int32 sizeOfStructsToHold );
    1.31 +
    1.32 +void *
    1.33 +VMS__get_from_recycle_pool( VMSRecyclePool *pool );
    1.34 +
    1.35 +void
    1.36 +VMS__recycle( void *chunkToRecycle, VMSRecyclePool *pool );
    1.37 +
    1.38 +void
    1.39 +VMS__free_recycle_pool( VMSRecyclePool *pool );
    1.40 +
    1.41  #endif
    1.42 \ No newline at end of file