Changeset 1340 for trunk/source/global/management/include/G4Allocator.hh
- Timestamp:
- Nov 5, 2010, 3:45:55 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/global/management/include/G4Allocator.hh
r1337 r1340 25 25 // 26 26 // 27 // $Id: G4Allocator.hh,v 1.2 0 2010/03/30 08:17:24gcosmo Exp $28 // GEANT4 tag $Name: g eant4-09-04-beta-01$27 // $Id: G4Allocator.hh,v 1.21 2010/04/01 12:43:12 gcosmo Exp $ 28 // GEANT4 tag $Name: global-V09-03-22 $ 29 29 // 30 30 // … … 66 66 67 67 inline void ResetStorage(); 68 // Returns allocated storage to the free store, resets 69 // allocator and page sizes. 68 // Returns allocated storage to the free store, resets allocator. 70 69 // Note: contents in memory are lost using this call ! 71 70 72 71 inline size_t GetAllocatedSize() const; 73 72 // Returns the size of the total memory allocated 73 inline int GetNoPages() const; 74 // Returns the total number of allocated pages 75 inline size_t GetPageSize() const; 76 // Returns the current size of a page 77 inline void IncreasePageSize( unsigned int sz ); 78 // Resets allocator and increases default page size of a given factor 74 79 75 80 public: // without description … … 213 218 214 219 // ************************************************************ 220 // GetNoPages 221 // ************************************************************ 222 // 223 template <class Type> 224 int G4Allocator<Type>::GetNoPages() const 225 { 226 return mem.GetNoPages(); 227 } 228 229 // ************************************************************ 230 // GetPageSize 231 // ************************************************************ 232 // 233 template <class Type> 234 size_t G4Allocator<Type>::GetPageSize() const 235 { 236 return mem.GetPageSize(); 237 } 238 239 // ************************************************************ 240 // IncreasePageSize 241 // ************************************************************ 242 // 243 template <class Type> 244 void G4Allocator<Type>::IncreasePageSize( unsigned int sz ) 245 { 246 ResetStorage(); 247 mem.GrowPageSize(sz); 248 } 249 250 // ************************************************************ 215 251 // operator== 216 252 // ************************************************************
Note: See TracChangeset
for help on using the changeset viewer.