IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 7, 2006, 1:16:44 PM (20 years ago)
Author:
rhl
Message:

Support p_psMemAllocatePersistent (bug report 753)

File:
1 edited

Legend:

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

    r7134 r7414  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2006-05-18 01:22:48 $
     10*  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2006-06-07 23:16:44 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    6161static bool safeThreads = true;
    6262
     63// private boolean for deciding if allocated memory is persistent
     64static bool memory_is_persistent = false;
     65
    6366static psS32 recycleBins = 13;
    6467static psS32 recycleBinSize[14] = {
     
    330333}
    331334
     335/*
     336 * Set whether allocated memory is persistent
     337 */
     338bool p_psMemAllocatePersistent(bool is_persistent)
     339{
     340    const bool old = memory_is_persistent;
     341    memory_is_persistent = is_persistent;
     342
     343    return old;
     344}
     345
     346/*
     347 * Actually allocate memory
     348 */
    332349psPtr p_psAlloc(size_t size,
    333350                const char *file,
     
    398415    ptr->file = file;
    399416    ptr->freeFunc = NULL;
    400     ptr->persistent = false;
     417    ptr->persistent = memory_is_persistent;
    401418    *(psU32 *)&ptr->lineno = lineno;
    402419    *(psPtr *)((int8_t *) (ptr + 1) + size) = P_PS_MEMMAGIC;
Note: See TracChangeset for help on using the changeset viewer.