IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 19, 2004, 10:14:04 AM (22 years ago)
Author:
desonia
Message:

updated the memory management to keep track of the memory via double-linked-listing the blocks together.

File:
1 edited

Legend:

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

    r432 r451  
    1414 *  @author Robert Lupton, Princeton University
    1515 *
    16  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    17  *  @date $Date: 2004-04-16 02:18:57 $
     16 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     17 *  @date $Date: 2004-04-19 20:14:04 $
    1818 *
    1919 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2525 *  aligned for all storage types.
    2626 */
    27 typedef struct
     27typedef struct psMemBlock
    2828{
    29     const void *startblock;             ///< initialised to p_psMEMMAGIC
     29    const void* startblock;             ///< initialised to p_psMEMMAGIC
     30        struct psMemBlock* previousBlock;   ///< previous block in allocation list
     31        struct psMemBlock* nextBlock;       ///< next block allocation list
    3032    const unsigned long id;             ///< a unique ID for this allocation
    31     const char *file;                   ///< set from __FILE__ in e.g. p_psAlloc
     33    const char* file;                   ///< set from __FILE__ in e.g. p_psAlloc
    3234    const int lineno;                   ///< set from __LINE__ in e.g. p_psAlloc
    33     int refCounter;                     ///< how many times pointer is referenced
    34     const void **endpost;               ///< initialised to p_psMEMMAGIC
    35     const void *endblock;               ///< initialised to p_psMEMMAGIC
     35    unsigned int refCounter;            ///< how many times pointer is referenced
     36    const void* endblock;               ///< initialised to p_psMEMMAGIC
    3637}
    3738psMemBlock;
     
    4344typedef long (*psMemFreeCallback)(const psMemBlock *ptr);
    4445
    45 /// prototype of a callback used in error conditions
     46/** prototype of a callback used in error conditions
     47 *
     48 *  This callback should never try to call psAlloc or psFree.
     49 *
     50 */
    4651typedef void (*psMemProblemCallback)(const psMemBlock *ptr, const char *file, int lineno);
    4752
Note: See TracChangeset for help on using the changeset viewer.