Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
annotate vmalloc.h @ 106:4dd55d2cc594
Created branch perf_counters.
| author | Nina Engelhardt |
|---|---|
| date | Tue, 23 Aug 2011 18:53:46 +0200 |
| parents | 9ddbb071142d |
| children | ca154ebe2b6c dbfc8382d546 c11b9dcf6d24 |
| rev | line source |
|---|---|
| Me@50 | 1 /* |
| Me@50 | 2 * Copyright 2009 OpenSourceCodeStewardshipFoundation.org |
| Me@50 | 3 * Licensed under GNU General Public License version 2 |
| Me@50 | 4 * |
| Me@50 | 5 * Author: seanhalle@yahoo.com |
| Me@50 | 6 * |
| Me@50 | 7 * Created on November 14, 2009, 9:07 PM |
| Me@50 | 8 */ |
| Me@50 | 9 |
| Me@65 | 10 #ifndef _VMALLOC_H |
| Me@65 | 11 #define _VMALLOC_H |
| Me@65 | 12 |
| Me@50 | 13 #include <malloc.h> |
| msach@76 | 14 #include <inttypes.h> |
| Me@50 | 15 #include "VMS_primitive_data_types.h" |
| Me@50 | 16 |
| Me@50 | 17 typedef struct _MallocProlog MallocProlog; |
| Me@50 | 18 |
| Me@50 | 19 struct _MallocProlog |
| Me@50 | 20 { |
| Me@50 | 21 MallocProlog *nextChunkInFreeList; |
| Me@50 | 22 MallocProlog *prevChunkInFreeList; |
| Me@50 | 23 MallocProlog *nextHigherInMem; |
| Me@50 | 24 MallocProlog *nextLowerInMem; |
| Me@50 | 25 }; |
| Me@50 | 26 //MallocProlog |
| Me@50 | 27 |
| Me@50 | 28 typedef struct |
| Me@50 | 29 { |
| Me@50 | 30 MallocProlog *firstChunkInFreeList; |
| msach@76 | 31 int32 numInList; //TODO not used |
| Me@50 | 32 } |
| Me@50 | 33 FreeListHead; |
| Me@50 | 34 |
| Me@50 | 35 void * |
| msach@76 | 36 VMS__malloc( size_t sizeRequested ); |
| Me@50 | 37 |
| msach@78 | 38 void * |
| msach@78 | 39 VMS__malloc_aligned( size_t sizeRequested ); |
| msach@78 | 40 |
| Me@50 | 41 void |
| Me@50 | 42 VMS__free( void *ptrToFree ); |
| Me@50 | 43 |
| Me@53 | 44 /*Allocates memory from the external system -- higher overhead |
| Me@53 | 45 */ |
| Me@53 | 46 void * |
| msach@76 | 47 VMS__malloc_in_ext( size_t sizeRequested ); |
| Me@53 | 48 |
| Me@53 | 49 /*Frees memory that was allocated in the external system -- higher overhead |
| Me@53 | 50 */ |
| Me@53 | 51 void |
| Me@53 | 52 VMS__free_in_ext( void *ptrToFree ); |
| Me@53 | 53 |
| Me@53 | 54 |
| Me@50 | 55 MallocProlog * |
| Me@53 | 56 VMS_ext__create_free_list(); |
| Me@50 | 57 |
| Me@50 | 58 void |
| Me@50 | 59 VMS_ext__free_free_list( MallocProlog *freeListHead ); |
| Me@65 | 60 |
| Me@65 | 61 #endif |
