FreeNOS
Data Structures
liballoc

Memory allocator library for managing the dynamic heap and virtual memory mappings. More...

Data Structures

class  Allocator
 Memory Allocator. More...
 
class  BitAllocator
 Bit memory allocator. More...
 
class  BubbleAllocator
 Keeps growing allocated memory, and can't actually free memory (hence the name). More...
 
class  PoolAllocator
 Memory allocator which uses pools that each manage same-sized objects. More...
 
class  SplitAllocator
 Allocator which separates kernel mapped memory at virtual and physical addresses. More...
 

Dynamic memory allocation.

void * operator new (__SIZE_TYPE__ sz)
 Allocate new memory. More...
 
void * operator new[] (__SIZE_TYPE__ sz)
 Allocate memory for an array. More...
 
void operator delete (void *mem)
 Free memory back to the current Allocator. More...
 
void operator delete[] (void *mem)
 Uses the Heap class to free memory, with the delete[] operator. More...
 
void * operator new (__SIZE_TYPE__ sz, Address addr)
 Let the new() operator return the given memory address. More...
 

Detailed Description

Memory allocator library for managing the dynamic heap and virtual memory mappings.

Function Documentation

◆ operator delete()

void operator delete ( void *  mem)
inline

Free memory back to the current Allocator.

Parameters
memPoints to memory to release.

Definition at line 243 of file Allocator.h.

References Allocator::getDefault(), and Allocator::release().

◆ operator delete[]()

void operator delete[] ( void *  mem)
inline

Uses the Heap class to free memory, with the delete[] operator.

Parameters
memPoints to memory to release.

Definition at line 253 of file Allocator.h.

References Allocator::getDefault(), and Allocator::release().

◆ operator new() [1/2]

void* operator new ( __SIZE_TYPE__  sz)
inline

Allocate new memory.

Parameters
szAmount of memory to allocate.

Definition at line 207 of file Allocator.h.

References Allocator::Range::address, Allocator::Range::alignment, Allocator::allocate(), Allocator::getDefault(), NULL, Allocator::Range::size, and Allocator::Success.

◆ operator new() [2/2]

void* operator new ( __SIZE_TYPE__  sz,
Address  addr 
)
inline

Let the new() operator return the given memory address.

Parameters
szSize to allocate (ignored).
addrMemory address to return.

Definition at line 266 of file Allocator.h.

◆ operator new[]()

void* operator new[] ( __SIZE_TYPE__  sz)
inline

Allocate memory for an array.

Parameters
szAmount of memory to allocate.

Definition at line 225 of file Allocator.h.

References Allocator::Range::address, Allocator::Range::alignment, Allocator::allocate(), Allocator::getDefault(), NULL, Allocator::Range::size, and Allocator::Success.