Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
view 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 source
1 /*
2 * Copyright 2009 OpenSourceCodeStewardshipFoundation.org
3 * Licensed under GNU General Public License version 2
4 *
5 * Author: seanhalle@yahoo.com
6 *
7 * Created on November 14, 2009, 9:07 PM
8 */
10 #ifndef _VMALLOC_H
11 #define _VMALLOC_H
13 #include <malloc.h>
14 #include "VMS_primitive_data_types.h"
16 typedef struct _MallocProlog MallocProlog;
18 struct _MallocProlog
19 {
20 MallocProlog *nextChunkInFreeList;
21 MallocProlog *prevChunkInFreeList;
22 MallocProlog *nextHigherInMem;
23 MallocProlog *nextLowerInMem;
24 };
25 //MallocProlog
27 typedef struct
28 {
29 MallocProlog *firstChunkInFreeList;
30 int32 numInList;
31 }
32 FreeListHead;
34 typedef struct
35 {
36 int32 hasNewStructs;
37 int32 sizeOfStructs;
38 int32 currArraySize;
39 void **arrays;
40 PrivDynArrayInfo *arraysInfo;
41 char *ptrToNextStruct;
42 char *ptrToTopOfCurrArray;
43 PrivQueueStruc *recycleQ;
44 }
45 VMSRecyclePool;
47 void *
48 VMS__malloc( int32 sizeRequested );
50 void
51 VMS__free( void *ptrToFree );
53 /*Allocates memory from the external system -- higher overhead
54 */
55 void *
56 VMS__malloc_in_ext( int32 sizeRequested );
58 /*Frees memory that was allocated in the external system -- higher overhead
59 */
60 void
61 VMS__free_in_ext( void *ptrToFree );
64 MallocProlog *
65 VMS_ext__create_free_list();
67 void
68 VMS_ext__free_free_list( MallocProlog *freeListHead );
70 //==========================================================================
72 VMSRecyclePool *
73 VMS__make_recycle_pool( int32 sizeOfStructsToHold );
75 void *
76 VMS__get_from_recycle_pool( VMSRecyclePool *pool );
78 void
79 VMS__recycle( void *chunkToRecycle, VMSRecyclePool *pool );
81 void
82 VMS__free_recycle_pool( VMSRecyclePool *pool );
84 #endif
