| 233 | } |
| 234 | |
| 235 | void asCMemoryMgr::FreeScriptNode(void *ptr) |
| 236 | { |
| 237 | ENTERCRITICALSECTION(cs); |
| 238 | |
| 239 | // Pre allocate memory for the array to avoid slow growth |
| 240 | if( scriptNodePool.GetLength() == 0 ) |
| 241 | scriptNodePool.Allocate(100, 0); |
| 242 | |
| 243 | scriptNodePool.PushLast(ptr); |
| 244 | |
| 245 | #ifdef AS_DEBUG |
| 246 | // clear the memory to facilitate identification of use after free |
| 247 | memset(ptr, 0xCDCDCDCD, sizeof(asCScriptNode)); |
| 248 | #endif |
| 249 | |
| 250 | LEAVECRITICALSECTION(cs); |
| 251 | } |
| 252 | |
| 253 | #ifndef AS_NO_COMPILER |
| 254 |