comparison vmalloc.h @ 102:def70e32cf2c

Malloc with easy shave off
author Merten Sach <msach@mailbox.tu-berlin.de>
date Wed, 03 Aug 2011 13:23:32 +0200
parents ca154ebe2b6c
children 62c59f2ac9f1
comparison
equal deleted inserted replaced
6:94464f59a33c 7:0835c35638d7
16 16
17 #define SMALL_CHUNK_SIZE 32 17 #define SMALL_CHUNK_SIZE 32
18 #define SMALL_CHUNK_COUNT 4 18 #define SMALL_CHUNK_COUNT 4
19 #define LOWER_BOUND 128 19 #define LOWER_BOUND 128
20 #define CHUNK_INCREASE_RATE 1.25 20 #define CHUNK_INCREASE_RATE 1.25
21 #define MAX_SMALL_CHUNKS 20
22 #define SMALL_CHUNKS_ALLOCATION 5
21 23
22 #define LOG54 0.096910013 24 #define LOG54 0.096910013
23 #define LOG128 2.10720997 25 #define LOG128 2.10720997
24 26
25 typedef struct _MallocProlog MallocProlog; 27 typedef struct _MallocProlog MallocProlog;
36 typedef struct MallocArrays MallocArrays; 38 typedef struct MallocArrays MallocArrays;
37 39
38 struct MallocArrays 40 struct MallocArrays
39 { 41 {
40 MallocProlog **smallChunks; 42 MallocProlog **smallChunks;
43 uint32 smallChunkCount[SMALL_CHUNK_COUNT];
41 MallocProlog **bigChunks; 44 MallocProlog **bigChunks;
45 void *memSpace;
42 uint32 containerCount; 46 uint32 containerCount;
43 }; 47 };
44 //MallocArrays 48 //MallocArrays
45 49
46 typedef struct 50 typedef struct
72 76
73 MallocArrays * 77 MallocArrays *
74 VMS_ext__create_free_list(); 78 VMS_ext__create_free_list();
75 79
76 void 80 void
77 VMS_ext__free_free_list( MallocProlog *freeListHead ); 81 VMS_ext__free_free_list(MallocArrays *freeLists );
78 82
79 #endif 83 #endif