Panda3D

Loading...
Searching...
No Matches
Classes | Macros
memoryBase.h File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

`#include "dtoolbase.h"`
`#include "memoryHook.h"`

Go to the source code of this file.

## Classes
class | MemoryBase
| This class is intended to be the base class of all objects in Panda that might be allocated and deleted via the new and delete operators. More...

## Macros
#define | ALLOC_MEMORY_BASE

## Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
  drose

Date
  2006-11-16

Definition in file memoryBase.h.

## Macro Definition Documentation

## ◆ ALLOC_MEMORY_BASE

#define ALLOC_MEMORY_BASE

Value:
inline void *operator new(size_t size) RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT) { \
return PANDA_MALLOC_SINGLE(size); \
} \
inline void *operator new(size_t size, void *ptr) { \
(void) size; \
return ptr; \
} \
inline void operator delete(void *ptr) { \
if (ptr != nullptr) { \
PANDA_FREE_SINGLE(ptr); \
} \
} \
inline void operator delete(void *, void *) { \
} \
inline void *operator new[](size_t size) RETURNS_ALIGNED(MEMORY_HOOK_ALIGNMENT) { \
return PANDA_MALLOC_ARRAY(size); \
} \
inline void *operator new[](size_t size, void *ptr) { \
(void) size; \
return ptr; \
} \
inline void operator delete[](void *ptr) { \
if (ptr != nullptr) { \
PANDA_FREE_ARRAY(ptr); \
} \
} \
inline void operator delete[](void *, void *) { \
}

Definition at line 26 of file memoryBase.h.