|
Adun
0.83
|
#import <AdunMemoryManager.h>
Public Member Functions | |
| (void *) | - allocateArrayOfSize: |
| (void) | - freeArray: |
| (void) | - freeMatrix: |
| (void) | - freeIntMatrix: |
| (AdMatrix *) | - allocateMatrixWithRows:withColumns: |
| (IntMatrix *) | - allocateIntMatrixWithRows:withColumns: |
Static Public Member Functions | |
| (id) | + appMemoryManager |
AdMemoryManager provides memory allocation functionality to the framework. It creates ::AdMatrix and IntMatrix structures aswell as C arrays. AdMemoryManager must be used to free any structures it creates via its free methods.
AdMemoryManager is a singleton. Only one instance of it exists per simulation. Use appMemoryManager (AdMemoryManager) to return the simulations AdMemoryManager instance.
Defaults:
An applications AdMemoryManager instance will output statistics on each allocation/deallocation if a default called OutputMemoryStatistics exists in the applications default domain and it is set to YES.
Before and after each event the values (in MB's) returned by the libc function mallinfo() for arena, hblks, uordblks and fordbblks are written to stderr.
| - (void *) allocateArrayOfSize: | (size_t) | size |
Allocates an array of size size The elements of the array are set to 0
| size | the size of the array in bytes |
| - (IntMatrix *) allocateIntMatrixWithRows: | (int) | no_rows | |
| withColumns: | (int) | no_columns | |
| - (AdMatrix *) allocateMatrixWithRows: | (int) | no_rows | |
| withColumns: | (int) | no_columns | |
Allocates an ::AdMatrix with the requseted dimensions
| no_rows | The number of rows in the matrix |
| no_columns | The number of columns in the matrix |
| + (id) appMemoryManager |
Returns the shared memory manager for the application.
| - (void) freeArray: | (void*) | array |
Frees an array allocated with allocateArrayOfSize:
| array | A pointer to the first element of the array to be freed i.e. array[0] |
| - (void) freeIntMatrix: | (IntMatrix*) | matrix |
Frees an ::Intmatrix allocated with AdMemoryManager::allocateIntMatrixWithRows:withColumns
| matrix | a pointer to the IntMatrix struct |
| - (void) freeMatrix: | (AdMatrix*) | matrix |
Frees an ::AdMatrix allocated with AdMemoryManager::allocateMatrixWithRows:withColumns
| matrix | a pointer to the ::AdMatrix struct |
1.8.1