Nebula
Loading...
Searching...
No Matches
osxmemorypool.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
11#include "core/types.h"
12
13//------------------------------------------------------------------------------
14namespace OSX
15{
17{
18public:
24 static uint ComputeAlignedBlockSize(uint blockSize);
26 void Setup(Memory::HeapType heapType, uint blockSize, uint numBlocks);
28 void* Alloc();
30 void Free(void* ptr);
32 bool IsPoolBlock(void* ptr) const;
34 uint GetNumBlocks() const;
36 uint GetBlockSize() const;
40 uint GetPoolSize() const;
42#if NEBULA_MEMORY_STATS
43 uint GetAllocCount() const;
44#endif
45};
46
47//------------------------------------------------------------------------------
50#if NEBULA_MEMORY_STATS
51inline uint
52OSXMemoryPool::GetAllocCount() const
53{
54 n_error("NOT IMPLEMENTED!\n");
55 return 0;
56}
57#endif
58
59//------------------------------------------------------------------------------
62inline uint
64{
65 n_error("NOT IMPLEMENTED!\n");
66 return 0;
67}
68
69//------------------------------------------------------------------------------
72inline uint
74{
75 n_error("NOT IMPLEMENTED!\n");
76 return 0;
77}
78
79//------------------------------------------------------------------------------
82inline uint
84{
85 n_error("NOT IMPLEMENTED!\n");
86 return 0;
87}
88
89//------------------------------------------------------------------------------
92inline uint
94{
95 n_error("NOT IMPLEMENTED!\n");
96 return 0;
97}
98
99//------------------------------------------------------------------------------
102inline uint
104{
105 n_error("NOT IMPLEMENTED!\n");
106 return 0;
107}
108
109//------------------------------------------------------------------------------
112inline bool
114{
115 n_error("NOT IMPLEMENTED!\n");
116 return false;
117}
118
119} // namespace OSX
120//------------------------------------------------------------------------------
121
FIXME: IMPLEMENT ME!
Definition osxmemorypool.h:17
uint GetNumBlocks() const
get number of allocated blocks in pool
Definition osxmemorypool.h:73
~OSXMemoryPool()
destructor
Definition osxmemorypool.cc:23
bool IsPoolBlock(void *ptr) const
return true if block is owned by this pool
Definition osxmemorypool.h:113
OSXMemoryPool()
constructor
Definition osxmemorypool.cc:15
uint GetPoolSize() const
get pool size
Definition osxmemorypool.h:103
void * Alloc()
allocate a block from the pool (NOTE: returns 0 if pool exhausted!)
Definition osxmemorypool.cc:42
uint GetBlockSize() const
get block size
Definition osxmemorypool.h:83
void Setup(Memory::HeapType heapType, uint blockSize, uint numBlocks)
setup the memory pool
Definition osxmemorypool.cc:33
static uint ComputeAlignedBlockSize(uint blockSize)
compute the actual block size including alignment and management data
Definition osxmemorypool.h:63
void Free(void *ptr)
deallocate a block from the pool
Definition osxmemorypool.cc:52
uint GetAlignedBlockSize() const
get aligned block size
Definition osxmemorypool.h:93
void __cdecl n_error(const char *msg,...)
This function is called when a serious situation is encountered which requires abortion of the applic...
Definition debug.cc:138
HeapType
Heap types are defined here.
Definition osxmemoryconfig.h:25
Definition osxsysfunc.h:21
unsigned int uint
Definition types.h:31