#include "memory.h"Go to the source code of this file.
Functions | |
| void | agent_zap (T &x) |
| void | agent_zaparr (T &x) |
| T* | agent_newarr (T **dest, size_t size) |
| T* | agent_new (T **dest) |
Variables | |
| const char | memid [] = "\100$ Free Agent: memory.cpp, v 0.1 2002/05/29 red0x Exp $" |
Definition in file memory.cpp.
|
|
Allocate new memory (Template Function)
Definition at line 79 of file memory.cpp. 00080 {
00081 *dest = new T;
00082 return *dest;
00083 }
|
|
|
Allocate a new array (Template Function)
Definition at line 61 of file memory.cpp. 00062 {
00063 {assert(size > 0);}
00064 //add a pad, for security
00065 size_t tmpii = size + SAFE_MEM;
00066 *dest = new T[tmpii];
00067 //clear it
00068 memset(*dest, 0, tmpii);
00069 return *dest;
00070 }
|
|
|
Delete memory (Template Function)
Definition at line 33 of file memory.cpp. 00034 {
00035 {assert(x != NULL);}
00036 delete x;
00037 x = NULL;
00038 }
|
|
|
Delete an array (Template Function)
Definition at line 46 of file memory.cpp. 00047 {
00048 {assert(x != NULL);}
00049 delete [] x;
00050 x = NULL;
00051 }
|
|
|
Definition at line 25 of file memory.cpp. |
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001