Changeset 10899 for branches/jch-memory/psLib/src/sys/psMemory.h
- Timestamp:
- Jan 4, 2007, 11:09:32 AM (20 years ago)
- File:
-
- 1 edited
-
branches/jch-memory/psLib/src/sys/psMemory.h (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/jch-memory/psLib/src/sys/psMemory.h
r10896 r10899 12 12 * @ingroup MemoryManagement 13 13 * 14 * @version $Revision: 1.61.2. 2$ $Name: not supported by cvs2svn $15 * @date $Date: 2007-01-0 3 22:25:33$14 * @version $Revision: 1.61.2.3 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2007-01-04 21:09:32 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 72 72 size_t userMemorySize; ///< the size of the user-portion of the memory block 73 73 const psMemId id; ///< a unique ID for this allocation 74 const pthread_t tid; ///< set from pthread_self(); 74 75 const char *file; ///< set from __FILE__ in e.g. p_psAlloc 75 76 const unsigned int lineno; ///< set from __LINE__ in e.g. p_psAlloc 77 const char *func; ///< set from __func__ 76 78 psReferenceCount refCounter; ///< how many times pointer is referenced 77 79 bool persistent; ///< marks if this non-user persistent data like error stack, etc. … … 137 139 psPtr p_psAlloc( 138 140 size_t size, ///< Size required 139 const char *filename, ///< File of call 140 unsigned int lineno ///< Line number of call 141 const char *filename, ///< File of caller 142 unsigned int lineno, ///< Line number of caller 143 const char *func ///< Function name of caller 141 144 ); 142 145 143 146 /// Memory allocation. psAlloc sends file and line number to p_psAlloc. 144 147 #ifndef SWIG 145 #define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__) 148 #define psAlloc(size) \ 149 p_psAlloc(size, __FILE__, __LINE__, __func__) 146 150 #endif // ! SWIG 147 151 … … 256 260 psPtr ptr, ///< Pointer to re-allocate 257 261 size_t size, ///< Size required 258 const char *filename, ///< File of call 259 unsigned int lineno ///< Line number of call 262 const char *filename, ///< File of caller 263 unsigned int lineno, ///< Line number of caller 264 const char *func ///< Function name of caller 260 265 ); 261 266 262 267 /// Memory re-allocation. psRealloc sends file and line number to p_psRealloc. 263 268 #ifndef SWIG 264 #define psRealloc(ptr, size) p_psRealloc(ptr, size, __FILE__, __LINE__) 269 #define psRealloc(ptr, size) \ 270 p_psRealloc(ptr, size, __FILE__, __LINE__, __func__) 265 271 #endif // ! SWIG 266 272 … … 276 282 ); 277 283 #else // #ifdef DOXYGEN 278 void p_psFree(279 psPtr ptr, ///< Pointer to free280 const char *filename, ///< File of call281 unsigned int lineno ///< Line number of call282 );283 284 284 285 /// Free memory. psFree sends file and line number to p_psFree. 285 286 #ifndef SWIG 286 //#define psFree(ptr) { p_ps Free((psPtr)ptr, __FILE__, __LINE__); *(void**)&(ptr) = NULL; }287 #define psFree(ptr) { p_ps Free((psPtr)ptr, __FILE__, __LINE__); }287 //#define psFree(ptr) { p_psMemDecrRefCounter((psPtr)ptr, __FILE__, __LINE__); *(void**)&(ptr) = NULL; } 288 #define psFree(ptr) { p_psMemDecrRefCounter((psPtr)ptr, __FILE__, __LINE__); } 288 289 #endif // ! SWIG 289 290 … … 379 380 #endif // !DOXYGEN 380 381 382 #if 0 // psMemSetRefCounter 381 383 /** Set reference counter and return the pointer 382 384 * … … 404 406 405 407 #endif // !DOXYGEN 408 #endif // psMemSetRefCounter 406 409 407 410 /** Set callback for problems.
Note:
See TracChangeset
for help on using the changeset viewer.
