Changeset 452 for trunk/psLib/src/sys/psMemory.h
- Timestamp:
- Apr 19, 2004, 10:19:22 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/sys/psMemory.h (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/sys/psMemory.h
r451 r452 14 14 * @author Robert Lupton, Princeton University 15 15 * 16 * @version $Revision: 1. 3$ $Name: not supported by cvs2svn $17 * @date $Date: 2004-04-19 20:1 4:04$16 * @version $Revision: 1.4 $ $Name: not supported by cvs2svn $ 17 * @date $Date: 2004-04-19 20:19:22 $ 18 18 * 19 19 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 { 29 29 const void* startblock; ///< initialised to p_psMEMMAGIC 30 struct psMemBlock* previousBlock; ///< previous block in allocation list31 struct psMemBlock* nextBlock; ///< next block allocation list30 struct psMemBlock* previousBlock; ///< previous block in allocation list 31 struct psMemBlock* nextBlock; ///< next block allocation list 32 32 const unsigned long id; ///< a unique ID for this allocation 33 33 const char* file; ///< set from __FILE__ in e.g. p_psAlloc … … 85 85 /// Check for memory leaks 86 86 int psMemCheckLeaks( 87 int id0, ///< don't list blocks with id < id088 psMemBlock ***arr, ///< pointer to array of pointers to leaked blocks, or NULL89 FILE *fd ///< print list of leaks to fd (or NULL)87 int id0, ///< don't list blocks with id < id0 88 psMemBlock ***arr, ///< pointer to array of pointers to leaked blocks, or NULL 89 FILE *fd ///< print list of leaks to fd (or NULL) 90 90 ); 91 91 92 92 /// Check for memory corruption 93 93 int psMemCheckCorruption( 94 int abort_on_error ///< Abort on detecting corruption?94 int abort_on_error ///< Abort on detecting corruption? 95 95 ); 96 96 97 97 /// Return reference counter 98 98 int psMemGetRefCounter( 99 void *vptr ///< Pointer to get refCounter for99 void *vptr ///< Pointer to get refCounter for 100 100 ); 101 101 102 102 /// Increment reference counter and return the pointer 103 103 void *psMemIncrRefCounter( 104 void *vptr ///< Pointer to increment refCounter, and return104 void *vptr ///< Pointer to increment refCounter, and return 105 105 ); 106 106 107 107 /// Decrement reference counter and return the pointer 108 108 void *psMemDecrRefCounter( 109 void *vptr ///< Pointer to decrement refCounter, and return109 void *vptr ///< Pointer to decrement refCounter, and return 110 110 ); 111 111 112 112 /// Set callback for problems 113 113 psMemProblemCallback psMemProblemCallbackSet( 114 psMemProblemCallback func ///< Function to run114 psMemProblemCallback func ///< Function to run 115 115 ); 116 116 117 117 /// Set callback for out-of-memory 118 118 psMemExhaustedCallback psMemExhaustedCallbackSet( 119 psMemExhaustedCallback func ///< Function to run119 psMemExhaustedCallback func ///< Function to run 120 120 ); 121 121 122 122 /// Set call back for when a particular memory block is allocated 123 123 psMemAllocateCallback psMemAllocateCallbackSet( 124 psMemAllocateCallback func ///< Function to run124 psMemAllocateCallback func ///< Function to run 125 125 ); 126 126 127 127 /// Set call back for when a particular memory block is freed 128 128 psMemFreeCallback psMemFreeCallbackSet( 129 psMemFreeCallback func ///< Function to run129 psMemFreeCallback func ///< Function to run 130 130 ); 131 131 … … 136 136 /// set p_psMemAllocateID to id 137 137 long psMemAllocateIDSet( 138 long id ///< ID to set138 long id ///< ID to set 139 139 ); 140 140 141 141 /// set p_psMemFreeID to id 142 142 long psMemFreeIDSet( 143 long id ///< ID to set143 long id ///< ID to set 144 144 ); 145 145 … … 159 159 */ 160 160 #ifndef PS_ALLOW_MALLOC 161 #define malloc(S) #pragma error Use of malloc is not allowed. Use psAlloc instead.162 #define realloc(P,S) #pragma error Use of realloc is not allowed. Use psRealloc instead.163 #define calloc(S) #pragma error Use of calloc is not allowed. Use psAlloc instead.164 #define free(P) #pragma error Use of free is not allowed. Use psFree instead.161 #define malloc(S) #pragma error Use of malloc is not allowed. Use psAlloc instead. 162 #define realloc(P,S) #pragma error Use of realloc is not allowed. Use psRealloc instead. 163 #define calloc(S) #pragma error Use of calloc is not allowed. Use psAlloc instead. 164 #define free(P) #pragma error Use of free is not allowed. Use psFree instead. 165 165 #endif 166 166
Note:
See TracChangeset
for help on using the changeset viewer.
