annotate 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
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@65 9 #ifndef _VMALLOC_H
Me@65 10 #define _VMALLOC_H
Me@65 11
Me@50 12 #include <malloc.h>
msach@76 13 #include <inttypes.h>
Me@50 14 #include "VMS_primitive_data_types.h"
msach@132 15 #include "ProcrContext.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;
msach@132 25 };
Me@50 26 //MallocProlog
msach@132 27
msach@132 28 typedef struct
msach@132 29 {
msach@132 30 uintptr_t procrID;
msach@132 31 MallocProlog *prevChunkInFreeList;
msach@132 32 MallocProlog *nextHigherInMem;
msach@132 33 MallocProlog *nextLowerInMem;
msach@132 34 } MallocPrologAllocated;
Me@50 35
Me@50 36 typedef struct
Me@50 37 {
Me@50 38 MallocProlog *firstChunkInFreeList;
msach@76 39 int32 numInList; //TODO not used
msach@132 40 } FreeListHead;
Me@50 41
Me@50 42 void *
msach@132 43 VMS__malloc_on_core(size_t sizeRequested, int procrID);
Me@50 44
msach@78 45 void *
msach@132 46 VMS__malloc(size_t sizeRequested);
msach@132 47
msach@132 48 void *
msach@132 49 VMS__malloc_in_lib(size_t sizeRequested, VirtProcr *VProc);
msach@78 50
Me@50 51 void
Me@50 52 VMS__free( void *ptrToFree );
Me@50 53
msach@132 54 void
msach@132 55 VMS__free_in_lib(void *ptrToFree, VirtProcr *VProc);
msach@132 56
msach@132 57 void
msach@132 58 VMS__free_on_core(void *ptrToFree, int procrID);
msach@132 59
Me@53 60 /*Allocates memory from the external system -- higher overhead
Me@53 61 */
Me@53 62 void *
msach@76 63 VMS__malloc_in_ext( size_t sizeRequested );
Me@53 64
Me@53 65 /*Frees memory that was allocated in the external system -- higher overhead
Me@53 66 */
Me@53 67 void
Me@53 68 VMS__free_in_ext( void *ptrToFree );
Me@53 69
Me@53 70
Me@50 71 MallocProlog *
Me@53 72 VMS_ext__create_free_list();
Me@50 73
Me@50 74 void
Me@50 75 VMS_ext__free_free_list( MallocProlog *freeListHead );
Me@65 76
Me@65 77 #endif