Me@50: /* Me@50: * Copyright 2009 OpenSourceCodeStewardshipFoundation.org Me@50: * Licensed under GNU General Public License version 2 Me@50: * Me@50: * Author: seanhalle@yahoo.com Me@50: * Me@50: * Created on November 14, 2009, 9:07 PM Me@50: */ Me@65: #ifndef _VMALLOC_H Me@65: #define _VMALLOC_H Me@65: Me@50: #include msach@76: #include Me@50: #include "VMS_primitive_data_types.h" msach@132: #include "ProcrContext.h" Me@50: Me@50: typedef struct _MallocProlog MallocProlog; Me@50: Me@50: struct _MallocProlog Me@50: { Me@50: MallocProlog *nextChunkInFreeList; Me@50: MallocProlog *prevChunkInFreeList; Me@50: MallocProlog *nextHigherInMem; Me@50: MallocProlog *nextLowerInMem; msach@132: }; Me@50: //MallocProlog msach@132: msach@132: typedef struct msach@132: { msach@132: uintptr_t procrID; msach@132: MallocProlog *prevChunkInFreeList; msach@132: MallocProlog *nextHigherInMem; msach@132: MallocProlog *nextLowerInMem; msach@132: } MallocPrologAllocated; Me@50: Me@50: typedef struct Me@50: { Me@50: MallocProlog *firstChunkInFreeList; msach@76: int32 numInList; //TODO not used msach@132: } FreeListHead; Me@50: Me@50: void * msach@132: VMS__malloc_on_core(size_t sizeRequested, int procrID); Me@50: msach@78: void * msach@132: VMS__malloc(size_t sizeRequested); msach@132: msach@132: void * msach@132: VMS__malloc_in_lib(size_t sizeRequested, VirtProcr *VProc); msach@78: Me@50: void Me@50: VMS__free( void *ptrToFree ); Me@50: msach@132: void msach@132: VMS__free_in_lib(void *ptrToFree, VirtProcr *VProc); msach@132: msach@132: void msach@132: VMS__free_on_core(void *ptrToFree, int procrID); msach@132: Me@53: /*Allocates memory from the external system -- higher overhead Me@53: */ Me@53: void * msach@76: VMS__malloc_in_ext( size_t sizeRequested ); Me@53: Me@53: /*Frees memory that was allocated in the external system -- higher overhead Me@53: */ Me@53: void Me@53: VMS__free_in_ext( void *ptrToFree ); Me@53: Me@50: MallocProlog * Me@53: VMS_ext__create_free_list(); Me@50: Me@50: void msach@135: VMS_ext__free_free_list( MallocProlog* freeListHead ); Me@65: Me@65: #endif