1 (* Copyright (C) DooM 2D:Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *)
16 {$INCLUDE a_modes.inc}
17 {$DEFINE MEM_DISABLE_ACCOUNTING}
20 interface
22 uses
23 SysUtils;
26 type
29 private
37 public
46 public
54 {$IF DEFINED(D2F_DEBUG) and NOT DEFINED(MEM_DISABLE_ACCOUNTING)}
57 {$ENDIF}
61 implementation
63 uses
64 hashtable;
66 type
69 var
73 // ////////////////////////////////////////////////////////////////////////// //
75 function hashhash (constref a: Pointer): LongWord; begin result := fnvHash(PByte(@a)^, sizeof(a)); end;
79 begin
82 begin
90 // ////////////////////////////////////////////////////////////////////////// //
92 begin
103 procedure TMemPool.setCapacity (acount: Integer); // ensure capacity for at least `acount` objects
104 begin
109 begin
114 begin
124 begin
129 // ////////////////////////////////////////////////////////////////////////// //
130 {$IF DEFINED(D2F_DEBUG) and NOT DEFINED(MEM_DISABLE_ACCOUNTING)}
132 var
133 {$IF DEFINED(D2F_DEBUG) and NOT DEFINED(MEM_DISABLE_ACCOUNTING)}
135 {$ENDIF}
137 begin
138 {$IF DEFINED(D2F_DEBUG) and NOT DEFINED(MEM_DISABLE_ACCOUNTING)}
141 {$ELSE}
144 {$ENDIF}
151 var
153 begin
157 {$ENDIF}
160 // ////////////////////////////////////////////////////////////////////////// //
161 {$IF DEFINED(D2F_DEBUG) and NOT DEFINED(MEM_DISABLE_ACCOUNTING)}
163 var
166 begin
170 begin
175 {$ENDIF}
178 initialization
179 //mpoolMap := TMemPool.Create('textmap', 64);
180 finalization
181 {$IF DEFINED(D2F_DEBUG) and NOT DEFINED(MEM_DISABLE_ACCOUNTING)}
183 {$ENDIF}