| 191 | } |
| 192 | |
| 193 | void asCMemoryMgr::FreeUnusedMemory() |
| 194 | { |
| 195 | // It's necessary to protect the scriptNodePool from multiple |
| 196 | // simultaneous accesses, as the parser is used by several methods |
| 197 | // that can be executed simultaneously. |
| 198 | ENTERCRITICALSECTION(cs); |
| 199 | |
| 200 | int n; |
| 201 | for( n = 0; n < (signed)scriptNodePool.GetLength(); n++ ) |
| 202 | userFree(scriptNodePool[n]); |
| 203 | scriptNodePool.Allocate(0, false); |
| 204 | |
| 205 | LEAVECRITICALSECTION(cs); |
| 206 | |
| 207 | // The engine already protects against multiple threads |
| 208 | // compiling scripts simultaneously so this pool doesn't have |
| 209 | // to be protected again. |
| 210 | for( n = 0; n < (signed)byteInstructionPool.GetLength(); n++ ) |
| 211 | userFree(byteInstructionPool[n]); |
| 212 | byteInstructionPool.Allocate(0, false); |
| 213 | } |
| 214 | |
| 215 | void *asCMemoryMgr::AllocScriptNode() |
| 216 | { |
no test coverage detected