Changeset 566
- Timestamp:
- May 3, 2004, 3:09:20 PM (22 years ago)
- Location:
- trunk/archive/pslib/src
- Files:
-
- 4 edited
-
Metadata/metadata.c (modified) (4 diffs)
-
Utils/memory.c (modified) (6 diffs)
-
Utils/tst_memory.c (modified) (2 diffs)
-
Utils/tst_trace.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/pslib/src/Metadata/metadata.c
r488 r566 26 26 { 27 27 if (ms == NULL) { 28 return; 29 } else if (psMemGetRefCounter(ms) > 1) { 30 psMemDecrRefCounter(ms); 28 31 return; 29 32 } … … 223 226 psError(__func__, PS_ERR_UNKNOWN, PS_NEW_ERROR, 224 227 "Key \"%s\" is already present in the metaDataSet 0x%x", item->name, ms); 225 //psMetadataItemFree(item);228 psMetadataItemFree(item); 226 229 227 230 return NULL; … … 236 239 /************************************************************************************************************/ 237 240 /* 238 * Convenience wrapper for psMetadataAppend ()241 * Convenience wrapper for psMetadataAppendItem() 239 242 */ 240 243 psMetadataItem *psMetadataAppend(psMetadata *restrict md, ///< Metadata to add to … … 258 261 } 259 262 260 261 263 /*****************************************************************************/ 262 264 /* -
trunk/archive/pslib/src/Utils/memory.c
r446 r566 54 54 static psMemExhaustedCB memExhaustedCB = memExhaustedCB0; 55 55 56 psMemExhaustedCB psMemExhausted SetCB(psMemExhaustedCB func)56 psMemExhaustedCB psMemExhaustedCBSet(psMemExhaustedCB func) 57 57 { 58 58 psMemExhaustedCB old = memExhaustedCB; … … 91 91 static psMemProblemCB memProblemCB = memProblemCB0; 92 92 93 psMemProblemCB psMemProblem SetCB(psMemProblemCB func)93 psMemProblemCB psMemProblemCBSet(psMemProblemCB func) 94 94 { 95 95 psMemProblemCB old = memProblemCB; … … 107 107 long p_psMemFreeID = 0; // notify user this block is freed 108 108 109 long psMem SetAllocateID(long id) // set p_psMemAllocateID to id109 long psMemAllocateIDSet(long id) // set p_psMemAllocateID to id 110 110 { 111 111 long old = p_psMemAllocateID; … … 115 115 } 116 116 117 long psMem SetFreeID(long id) // set p_psMemFreeID to id117 long psMemFreeIDSet(long id) // set p_psMemFreeID to id 118 118 { 119 119 long old = p_psMemFreeID; … … 153 153 static psMemFreeCB memFreeCB = memFreeCB0; 154 154 155 psMemAllocateCB psMemAllocate SetCB(psMemAllocateCB func)155 psMemAllocateCB psMemAllocateCBSet(psMemAllocateCB func) 156 156 { 157 157 psMemAllocateCB old = memAllocateCB; … … 162 162 } 163 163 164 psMemFreeCB psMemFree SetCB(psMemFreeCB func)164 psMemFreeCB psMemFreeCBSet(psMemFreeCB func) 165 165 { 166 166 psMemFreeCB old = memFreeCB; -
trunk/archive/pslib/src/Utils/tst_memory.c
r446 r566 9 9 * My callbacks 10 10 */ 11 static intmy_MemAllocateCB(const psMemBlock *ptr)11 static long my_MemAllocateCB(const psMemBlock *ptr) 12 12 { 13 13 static int incr = 0; // "p_psMemAllocateID += incr" … … 54 54 * Install my callbacks 55 55 */ 56 (void)psMemAllocate SetCB(my_MemAllocateCB);57 default_MemProblemCB = psMemProblem SetCB(my_MemProblemCB);58 (void)psMemExhausted SetCB(my_MemExhaustedCB);56 (void)psMemAllocateCBSet(my_MemAllocateCB); 57 default_MemProblemCB = psMemProblemCBSet(my_MemProblemCB); 58 (void)psMemExhaustedCBSet(my_MemExhaustedCB); 59 59 /* 60 60 * Request callback on first allocation 61 61 */ 62 (void)psMem SetAllocateID(1);62 (void)psMemAllocateIDSet(1); 63 63 /* 64 64 * Start allocating -
trunk/archive/pslib/src/Utils/tst_trace.c
r390 r566 6 6 #include "psLib.h" 7 7 8 static intmy_MemAllocateCB(const psMemBlock *ptr)8 static long my_MemAllocateCB(const psMemBlock *ptr) 9 9 { 10 10 static int n = 1; // "p_psMemAllocateID += n" … … 23 23 psSetLogFormat("NM"); // suppress some of the psLogMsg verbosity 24 24 25 (void)psMemAllocate SetCB(my_MemAllocateCB);26 //(void)psMemFree SetCB(my_MemAllocateCB);27 psMem SetAllocateID(1);28 psMem SetFreeID(14);25 (void)psMemAllocateCBSet(my_MemAllocateCB); 26 //(void)psMemFreeCBSet(my_MemAllocateCB); 27 psMemAllocateIDSet(1); 28 psMemFreeIDSet(14); 29 29 30 30 #if 0
Note:
See TracChangeset
for help on using the changeset viewer.
