Mercurial > cgi-bin > hgwebdir.cgi > VMS > VMS_Implementations > VMS_impls > VMS__MC_shared_impl
diff vmalloc.h @ 101:ca154ebe2b6c
Basic malloc without small chunks
| author | Merten Sach <msach@mailbox.tu-berlin.de> |
|---|---|
| date | Tue, 02 Aug 2011 15:44:28 +0200 |
| parents | 521c75d64cef |
| children | def70e32cf2c |
line diff
1.1 --- a/vmalloc.h Tue Jul 26 16:14:30 2011 +0200 1.2 +++ b/vmalloc.h Tue Aug 02 15:44:28 2011 +0200 1.3 @@ -14,6 +14,14 @@ 1.4 #include <inttypes.h> 1.5 #include "VMS_primitive_data_types.h" 1.6 1.7 +#define SMALL_CHUNK_SIZE 32 1.8 +#define SMALL_CHUNK_COUNT 4 1.9 +#define LOWER_BOUND 128 1.10 +#define CHUNK_INCREASE_RATE 1.25 1.11 + 1.12 +#define LOG54 0.096910013 1.13 +#define LOG128 2.10720997 1.14 + 1.15 typedef struct _MallocProlog MallocProlog; 1.16 1.17 struct _MallocProlog 1.18 @@ -24,6 +32,16 @@ 1.19 MallocProlog *nextLowerInMem; 1.20 }; 1.21 //MallocProlog 1.22 + 1.23 + typedef struct MallocArrays MallocArrays; 1.24 + 1.25 + struct MallocArrays 1.26 + { 1.27 + MallocProlog **smallChunks; 1.28 + MallocProlog **bigChunks; 1.29 + uint32 containerCount; 1.30 + }; 1.31 + //MallocArrays 1.32 1.33 typedef struct 1.34 { 1.35 @@ -52,7 +70,7 @@ 1.36 VMS__free_in_ext( void *ptrToFree ); 1.37 1.38 1.39 -MallocProlog * 1.40 +MallocArrays * 1.41 VMS_ext__create_free_list(); 1.42 1.43 void
