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