IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 7414


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

Support p_psMemAllocatePersistent (bug report 753)

Location:
trunk/psLib/src/sys
Files:
2 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;
  • trunk/psLib/src/sys/psMemory.h

    r7134 r7414  
    1212 *  @ingroup MemoryManagement
    1313 *
    14  *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2006-05-18 01:22:48 $
     14 *  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2006-06-07 23:16:44 $
    1616 *
    1717 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    209209);
    210210
     211/** Set whether allocated memory is persistent
     212 *
     213 *  Set whether allocated memory is persistent. The defeault is false.
     214 *
     215 *  @return bool:       The previous value of whether all allocated memory is persistent
     216 */
     217bool p_psMemAllocatePersistent(bool is_persistent); ///< Should all memory allocated be persistent?
     218
    211219/** Get the memory's persistent flag.
    212220 *
Note: See TracChangeset for help on using the changeset viewer.