comparison vmalloc.h @ 132:dbfc8382d546

distributed memory allocation interface - unfinished
author Merten Sach <msach@mailbox.tu-berlin.de>
date Fri, 16 Sep 2011 14:25:49 +0200
parents 521c75d64cef
children a9b72021f053
comparison
equal deleted inserted replaced
5:e9bdc899bcd1 13:0aa4a130cc19
4 * 4 *
5 * Author: seanhalle@yahoo.com 5 * Author: seanhalle@yahoo.com
6 * 6 *
7 * Created on November 14, 2009, 9:07 PM 7 * Created on November 14, 2009, 9:07 PM
8 */ 8 */
9
10 #ifndef _VMALLOC_H 9 #ifndef _VMALLOC_H
11 #define _VMALLOC_H 10 #define _VMALLOC_H
12 11
13 #include <malloc.h> 12 #include <malloc.h>
14 #include <inttypes.h> 13 #include <inttypes.h>
15 #include "VMS_primitive_data_types.h" 14 #include "VMS_primitive_data_types.h"
15 #include "ProcrContext.h"
16 16
17 typedef struct _MallocProlog MallocProlog; 17 typedef struct _MallocProlog MallocProlog;
18 18
19 struct _MallocProlog 19 struct _MallocProlog
20 { 20 {
21 MallocProlog *nextChunkInFreeList; 21 MallocProlog *nextChunkInFreeList;
22 MallocProlog *prevChunkInFreeList; 22 MallocProlog *prevChunkInFreeList;
23 MallocProlog *nextHigherInMem; 23 MallocProlog *nextHigherInMem;
24 MallocProlog *nextLowerInMem; 24 MallocProlog *nextLowerInMem;
25 }; 25 };
26 //MallocProlog 26 //MallocProlog
27
28 typedef struct
29 {
30 uintptr_t procrID;
31 MallocProlog *prevChunkInFreeList;
32 MallocProlog *nextHigherInMem;
33 MallocProlog *nextLowerInMem;
34 } MallocPrologAllocated;
27 35
28 typedef struct 36 typedef struct
29 { 37 {
30 MallocProlog *firstChunkInFreeList; 38 MallocProlog *firstChunkInFreeList;
31 int32 numInList; //TODO not used 39 int32 numInList; //TODO not used
32 } 40 } FreeListHead;
33 FreeListHead;
34 41
35 void * 42 void *
36 VMS__malloc( size_t sizeRequested ); 43 VMS__malloc_on_core(size_t sizeRequested, int procrID);
37 44
38 void * 45 void *
39 VMS__malloc_aligned( size_t sizeRequested ); 46 VMS__malloc(size_t sizeRequested);
47
48 void *
49 VMS__malloc_in_lib(size_t sizeRequested, VirtProcr *VProc);
40 50
41 void 51 void
42 VMS__free( void *ptrToFree ); 52 VMS__free( void *ptrToFree );
53
54 void
55 VMS__free_in_lib(void *ptrToFree, VirtProcr *VProc);
56
57 void
58 VMS__free_on_core(void *ptrToFree, int procrID);
43 59
44 /*Allocates memory from the external system -- higher overhead 60 /*Allocates memory from the external system -- higher overhead
45 */ 61 */
46 void * 62 void *
47 VMS__malloc_in_ext( size_t sizeRequested ); 63 VMS__malloc_in_ext( size_t sizeRequested );