My Project: dynamics.mod/NewtonDynamics/source/core/dgMemory.h File Reference

My Project

Classes | Macros | Typedefs | Functions
dgMemory.h File Reference
`#include "dgStdafx.h"`

Go to the source code of this file.

## Classes

class | dgMemoryAllocator
class | dgMemoryAllocator::dgMemoryBin
class | dgMemoryAllocator::dgMemoryBin::dgMemoryBinInfo
class | dgMemoryAllocator::dgMemoryCacheEntry
class | dgMemoryAllocator::dgMemoryInfo
class | dgMemoryAllocator::dgMemDirectory

## Macros

#define | DG_CLASS_ALLOCATOR_NEW(allocator) inline void *operator new (size_t size, dgMemoryAllocator* const allocator) { return dgMalloc(size, allocator);}
#define | DG_CLASS_ALLOCATOR_NEW_ARRAY(allocator) inline void *operator new[] (size_t size, dgMemoryAllocator* const allocator) { return dgMalloc(size, allocator);}
#define | DG_CLASS_ALLOCATOR_DELETE(allocator) inline void operator delete (void* const ptr, dgMemoryAllocator* const allocator) { dgFree(ptr); }
#define | DG_CLASS_ALLOCATOR_DELETE_ARRAY(allocator) inline void operator delete[] (void* const ptr, dgMemoryAllocator* const allocator) { dgFree(ptr); }
#define | DG_CLASS_ALLOCATOR_NEW_DUMMY inline void *operator new (size_t size) { dgAssert (0); return dgMalloc(size, NULL);}
#define | DG_CLASS_ALLOCATOR_NEW_ARRAY_DUMMY inline void *operator new[] (size_t size) { dgAssert (0); return dgMalloc(size, NULL);}
#define | DG_CLASS_ALLOCATOR_DELETE_DUMMY inline void operator delete (void* const ptr) { dgFree(ptr); }
#define | DG_CLASS_ALLOCATOR_DELETE_ARRAY_DUMMY inline void operator delete[] (void* const ptr) { dgFree(ptr); }
#define | DG_CLASS_ALLOCATOR(allocator)
#define | DG_MEMORY_GRANULARITY_BITS 5
#define | DG_MEMORY_GRANULARITY (1 << DG_MEMORY_GRANULARITY_BITS)
#define | DG_MEMORY_SIZE (1024 - 64)
#define | DG_MEMORY_BIN_SIZE (1024 * 16)
#define | DG_MEMORY_BIN_ENTRIES (DG_MEMORY_SIZE / DG_MEMORY_GRANULARITY)

## Typedefs

typedef void *(dgApi * | dgMemAlloc) (dgUnsigned32 size)
typedef void(dgApi * | dgMemFree) (void *const ptr, dgUnsigned32 size)

## Functions

void *dgApi | dgMalloc (size_t size, dgMemoryAllocator *const allocator)
void dgApi | dgFree (void *const ptr)
void *dgApi | dgMallocStack (size_t size)
void *dgApi | dgMallocAligned (size_t size, dgInt32 alignmentInBytes)
void dgApi | dgFreeStack (void *const ptr)
void | dgSetGlobalAllocators (dgMemAlloc alloc, dgMemFree free)
dgInt32 | dgGetMemoryUsed ()

## Macro Definition Documentation

## § DG_CLASS_ALLOCATOR

#define DG_CLASS_ALLOCATOR | ( |  | allocator | ) |

Value:
DG_CLASS_ALLOCATOR_DELETE(allocator) \
DG_CLASS_ALLOCATOR_DELETE_ARRAY(allocator) \
DG_CLASS_ALLOCATOR_NEW(allocator) \
DG_CLASS_ALLOCATOR_NEW_ARRAY(allocator) \
DG_CLASS_ALLOCATOR_NEW_DUMMY \
DG_CLASS_ALLOCATOR_NEW_ARRAY_DUMMY \
DG_CLASS_ALLOCATOR_DELETE_DUMMY \
DG_CLASS_ALLOCATOR_DELETE_ARRAY_DUMMY
DG_CLASS_ALLOCATOR_DELETE
#define DG_CLASS_ALLOCATOR_DELETE(allocator)
Definition: dgMemory.h:52

## § DG_CLASS_ALLOCATOR_DELETE

#define DG_CLASS_ALLOCATOR_DELETE | ( |  | allocator | ) | inline void operator delete (void* const ptr, dgMemoryAllocator* const allocator) { dgFree(ptr); }

## § DG_CLASS_ALLOCATOR_DELETE_ARRAY

#define DG_CLASS_ALLOCATOR_DELETE_ARRAY | ( |  | allocator | ) | inline void operator delete[] (void* const ptr, dgMemoryAllocator* const allocator) { dgFree(ptr); }

## § DG_CLASS_ALLOCATOR_DELETE_ARRAY_DUMMY

#define DG_CLASS_ALLOCATOR_DELETE_ARRAY_DUMMY inline void operator delete[] (void* const ptr) { dgFree(ptr); }

## § DG_CLASS_ALLOCATOR_DELETE_DUMMY

#define DG_CLASS_ALLOCATOR_DELETE_DUMMY inline void operator delete (void* const ptr) { dgFree(ptr); }

## § DG_CLASS_ALLOCATOR_NEW

#define DG_CLASS_ALLOCATOR_NEW | ( |  | allocator | ) | inline void *operator new (size_t size, dgMemoryAllocator* const allocator) { return dgMalloc(size, allocator);}

## § DG_CLASS_ALLOCATOR_NEW_ARRAY

#define DG_CLASS_ALLOCATOR_NEW_ARRAY | ( |  | allocator | ) | inline void *operator new[] (size_t size, dgMemoryAllocator* const allocator) { return dgMalloc(size, allocator);}

## § DG_CLASS_ALLOCATOR_NEW_ARRAY_DUMMY

#define DG_CLASS_ALLOCATOR_NEW_ARRAY_DUMMY inline void *operator new[] (size_t size) { dgAssert (0); return dgMalloc(size, NULL);}

## § DG_CLASS_ALLOCATOR_NEW_DUMMY

#define DG_CLASS_ALLOCATOR_NEW_DUMMY inline void *operator new (size_t size) { dgAssert (0); return dgMalloc(size, NULL);}

## § DG_MEMORY_BIN_ENTRIES

#define DG_MEMORY_BIN_ENTRIES (DG_MEMORY_SIZE / DG_MEMORY_GRANULARITY)

## § DG_MEMORY_BIN_SIZE

#define DG_MEMORY_BIN_SIZE (1024 * 16)

## § DG_MEMORY_GRANULARITY

#define DG_MEMORY_GRANULARITY (1 << DG_MEMORY_GRANULARITY_BITS)

## § DG_MEMORY_GRANULARITY_BITS

#define DG_MEMORY_GRANULARITY_BITS 5

## § DG_MEMORY_SIZE

#define DG_MEMORY_SIZE (1024 - 64)

## Typedef Documentation

## § dgMemAlloc

typedef void*(dgApi * dgMemAlloc) (dgUnsigned32 size)

## § dgMemFree

typedef void(dgApi * dgMemFree) (void *const ptr, dgUnsigned32 size)

## Function Documentation

## § dgFree()

void dgApi dgFree | ( | void *const | ptr | ) |

## § dgFreeStack()

void dgApi dgFreeStack | ( | void *const | ptr | ) |

## § dgGetMemoryUsed()

dgInt32 dgGetMemoryUsed | ( |  | ) |

## § dgMalloc()

void* dgApi dgMalloc | ( | size_t | size,
|  | dgMemoryAllocator *const | allocator
| ) |  |

## § dgMallocAligned()

void* dgApi dgMallocAligned | ( | size_t | size,
|  | dgInt32 | alignmentInBytes
| ) |  |

## § dgMallocStack()

void* dgApi dgMallocStack | ( | size_t | size | ) |

## § dgSetGlobalAllocators()

void dgSetGlobalAllocators | ( | dgMemAlloc | alloc,
|  | dgMemFree | free
| ) |  |