Skip to content
Snippets Groups Projects
Commit 78c8173e authored by Oliver Sander's avatar Oliver Sander
Browse files

Use enum name instead of INT for allocation mode parameters

[[Imported from SVN: r8467]]
parent 8ea01248
No related branches found
No related tags found
No related merge requests found
......@@ -277,7 +277,7 @@ HEAP *NS_PREFIX NewHeap (enum HeapType type, MEM size, void *buffer)
*/
/****************************************************************************/
void *NS_PREFIX GetMem (HEAP *theHeap, MEM n, INT mode)
void *NS_PREFIX GetMem (HEAP *theHeap, MEM n, HeapAllocMode mode)
{
BLOCK *theBlock,*newBlock;
long newsize,allocated;
......@@ -378,7 +378,7 @@ void *NS_PREFIX GetMem (HEAP *theHeap, MEM n, INT mode)
return(NULL);
}
void *NS_PREFIX GetMemUsingKey (HEAP *theHeap, MEM n, INT mode, INT key)
void *NS_PREFIX GetMemUsingKey (HEAP *theHeap, MEM n, HeapAllocMode mode, INT key)
{
if (theHeap->type==SIMPLE_HEAP)
{
......
......@@ -78,8 +78,9 @@ enum HeapType {GENERAL_HEAP, /**< Heap with alloc/free mechanis
SIMPLE_HEAP /**< Heap with mark/release mechanism*/
};
enum {FROM_TOP=1, /**< Allocate from top of stack */
FROM_BOTTOM=2 /**< Allocate from bottom of stack */
enum HeapAllocMode
{FROM_TOP=1, /**< Allocate from top of stack */
FROM_BOTTOM=2 /**< Allocate from bottom of stack */
};
/** \brief Number of free object pointers */
......@@ -216,8 +217,8 @@ INT InitHeaps (void);
/** @name Functions for the simple and general heap management */
/* @{ */
HEAP *NewHeap (enum HeapType type, MEM size, void *buffer);
void *GetMem (HEAP *theHeap, MEM n, INT mode);
void *GetMemUsingKey (HEAP *theHeap, MEM n, INT mode, INT key);
void *GetMem (HEAP *theHeap, MEM n, HeapAllocMode mode);
void *GetMemUsingKey (HEAP *theHeap, MEM n, HeapAllocMode mode, INT key);
void DisposeMem (HEAP *theHeap, void *buffer);
void *GetFreelistMemory (HEAP *theHeap, INT size);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment