IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 20, 2005, 3:40:10 PM (21 years ago)
Author:
drobbin
Message:

made minor changes in accordance with newest api-delta doc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psMemory.c

    r4556 r4589  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.59 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2005-07-15 02:33:54 $
     10*  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2005-07-21 01:40:10 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    102102}
    103103
    104 static void memProblemCallbackDefault( psMemBlock* ptr, const char *file, unsigned int lineno)
     104static void memProblemCallbackDefault(psMemBlock* ptr,
     105                                      const char *file,
     106                                      unsigned int lineno)
    105107{
    106108    if (ptr->refCounter < 1) {
     
    120122 * N.b. If the block wasn't allocated by psAlloc, it will appear corrupted
    121123 */
    122 static psS32 checkMemBlock(const psMemBlock* m, const char *funcName)
     124static psS32 checkMemBlock(const psMemBlock* m,
     125                           const char *funcName)
    123126{
    124127    // n.b. since this is called by psMemCheckCorruption while the memblock list is mutex locked,
     
    286289}
    287290
    288 psPtr p_psAlloc(size_t size, const char *file, unsigned int lineno)
     291psPtr p_psAlloc(size_t size,
     292                const char *file,
     293                unsigned int lineno)
    289294{
    290295
     
    370375}
    371376
    372 psPtr p_psRealloc(psPtr vptr, size_t size, const char *file, unsigned int lineno)
     377psPtr p_psRealloc(psPtr vptr,
     378                  size_t size,
     379                  const char *file,
     380                  unsigned int lineno)
    373381{
    374382    size = (size < recycleBinSize[0]) ? recycleBinSize[0] : size; // set the minimum size to allocate
     
    424432}
    425433
    426 void p_psFree(psPtr vptr, const char *file, unsigned int lineno)
     434void p_psFree(psPtr vptr,
     435              const char *filename,
     436              unsigned int lineno)
    427437{
    428438    if (vptr == NULL) {
     
    434444
    435445        psAbort(__func__,PS_ERRORTEXT_psMemory_MULTIPLE_FREE,
    436                 ptr->id, ptr->file, ptr->lineno, file, lineno);
     446                ptr->id, ptr->file, ptr->lineno, filename, lineno);
    437447    }
    438448
    439449    if (checkMemBlock(ptr, __func__) != 0) {
    440         memProblemCallback(ptr, file, lineno);
     450        memProblemCallback(ptr, filename, lineno);
    441451        psAbort(__func__,"Memory Corruption Detected.");
    442452    }
    443453
    444     (void)p_psMemDecrRefCounter(vptr, file, lineno);    // this handles the free, if required.
     454    (void)p_psMemDecrRefCounter(vptr, filename, lineno);    // this handles the free, if required.
    445455}
    446456
     
    448458 * Check for memory leaks.
    449459 */
    450 psS32 psMemCheckLeaks(psMemId id0, psMemBlock* ** arr, FILE * fd, psBool persistence)
     460int psMemCheckLeaks(psMemId id0,
     461                    psMemBlock* ** arr,
     462                    FILE * fd,
     463                    psBool persistence)
    451464{
    452465    psS32 nleak = 0;
     
    527540
    528541// increment and return refCounter
    529 psPtr p_psMemIncrRefCounter(psPtr vptr, const char *file, psS32 lineno)
     542psPtr p_psMemIncrRefCounter(psPtr vptr,
     543                            const char *file,
     544                            psS32 lineno)
    530545{
    531546    psMemBlock* ptr;
     
    549564
    550565// decrement and return refCounter
    551 psPtr p_psMemDecrRefCounter(psPtr vptr, const char *file, psS32 lineno)
     566psPtr p_psMemDecrRefCounter(psPtr vptr,
     567                            const char *file,
     568                            psS32 lineno)
    552569{
    553570    if (vptr == NULL) {
     
    640657}
    641658
    642 void psMemSetDeallocator(psPtr ptr, psFreeFunc freeFunc)
     659void psMemSetDeallocator(psPtr ptr,
     660                         psFreeFunc freeFunc)
    643661{
    644662    if (ptr == NULL) {
     
    655673
    656674}
    657 psFreeFunc psMemGetDeallocator(psPtr ptr)
     675psFreeFunc psMemGetDeallocator(const psPtr ptr)
    658676{
    659677    if (ptr == NULL) {
     
    685703}
    686704
    687 void p_psMemSetPersistent(psPtr vptr, bool value)
     705void p_psMemSetPersistent(psPtr vptr,
     706                          bool value)
    688707{
    689708    if (vptr == NULL) {
Note: See TracChangeset for help on using the changeset viewer.