Adun  0.83
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
AdunMemoryManager.h
1 /*
2  Project: Adun
3 
4  Copyright (C) 2005 Michael Johnston & Jordi Villą--Freixa
5 
6  Author: Michael Johnston
7 
8  This application is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public
10  License as published by the Free Software Foundation; either
11  version 2 of the License, or (at your option) any later version.
12 
13  This application is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU General Public
19  License along with this library; if not, write to the Free
20  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
21 */
22 #ifndef _ADUNMEMORYMANAGER_
23 #define _ADUNMEMORYMANAGER_
24 
25 #include <stdlib.h>
26 #ifndef __FREEBSD__
27 #include <malloc.h>
28 #endif
30 
51 @interface AdMemoryManager: NSObject
52 {
53  @private
54 #ifndef __FREEBSD__
55  struct mallinfo mem_struct;
56 #endif
57 #ifdef GNUSTEP
58  struct NSZoneStats matrixStats;
59 #endif
60  BOOL MEMORY_STATS;
61  NSZone* matrixZone;
62 }
63 
67 + (id) appMemoryManager;
71 - (void*) allocateArrayOfSize: (size_t) size;
74 - (void) freeArray: (void*)array;
78 - (void) freeMatrix: (AdMatrix*) matrix;
82 - (void) freeIntMatrix: (IntMatrix*) matrix;
89 - (AdMatrix*) allocateMatrixWithRows: (int) no_rows withColumns: (int) no_columns;
96 - (IntMatrix*) allocateIntMatrixWithRows: (int) no_rows withColumns: (int) no_columns;
97 @end
98 
99 #endif