IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 9, 2004, 12:44:25 PM (22 years ago)
Author:
desonia
Message:

fixed some stupid indent-induced formating problems and added doxygen
comments.

File:
1 edited

Legend:

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

    r1407 r1426  
    1515 *  @ingroup MemoryManagement
    1616 *
    17  *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
    18  *  @date $Date: 2004-08-07 00:06:06 $
     17 *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
     18 *  @date $Date: 2004-08-09 22:44:25 $
    1919 *
    2020 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6363typedef struct psMemBlock
    6464{
    65     const void *startblock;     // /< initialised to p_psMEMMAGIC
    66     struct psMemBlock *previousBlock;   // /< previous block in allocation list
    67     struct psMemBlock *nextBlock;       // /< next block allocation list
    68     psFreeFcn freeFcn;          // /< deallocator.  If NULL, use generic deallocation.
    69     size_t userMemorySize;      // /< the size of the user-portion of the memory block
    70     const psMemoryId id;        // /< a unique ID for this allocation
    71     const char *file;           // /< set from __FILE__ in e.g. p_psAlloc
    72     const int lineno;           // /< set from __LINE__ in e.g. p_psAlloc
    73     pthread_mutex_t refCounterMutex;    // /< mutex to ensure exclusive access to reference counter
    74     psReferenceCount refCounter;        // /< how many times pointer is referenced
    75     const void *endblock;       // /< initialised to p_psMEMMAGIC
     65    const void *startblock;     ///< initialised to p_psMEMMAGIC
     66    struct psMemBlock *previousBlock;   ///< previous block in allocation list
     67    struct psMemBlock *nextBlock;       ///< next block allocation list
     68    psFreeFcn freeFcn;          ///< deallocator.  If NULL, use generic deallocation.
     69    size_t userMemorySize;      ///< the size of the user-portion of the memory block
     70    const psMemoryId id;        ///< a unique ID for this allocation
     71    const char *file;           ///< set from __FILE__ in e.g. p_psAlloc
     72    const int lineno;           ///< set from __LINE__ in e.g. p_psAlloc
     73    pthread_mutex_t refCounterMutex;    ///< mutex to ensure exclusive access to reference counter
     74    psReferenceCount refCounter;        ///< how many times pointer is referenced
     75    const void *endblock;       ///< initialised to p_psMEMMAGIC
    7676}
    7777psMemBlock;
     
    8282 *  @ingroup memCallback
    8383 */
    84 typedef psMemoryId(*psMemAllocateCallback) (const psMemBlock * ptr      // /< the psMemBlock just allocated
     84typedef psMemoryId(*psMemAllocateCallback) (const psMemBlock * ptr      ///< the psMemBlock just allocated
    8585                                           );
    8686
     
    9090 *  @ingroup memCallback
    9191 */
    92 typedef psMemoryId(*psMemFreeCallback) (const psMemBlock * ptr  // /< the psMemBlock being freed
     92typedef psMemoryId(*psMemFreeCallback) (const psMemBlock * ptr  ///< the psMemBlock being freed
    9393                                       );
    9494
     
    100100 *  @ingroup memCallback
    101101 */
    102 typedef void (*psMemProblemCallback) (const psMemBlock * ptr,   // /< the pointer to the problematic memory
     102typedef void (*psMemProblemCallback) (const psMemBlock * ptr,   ///< the pointer to the problematic memory
    103103                                      // block.
    104                                       const char *file, // /< the file in which the problem originated
    105                                       int lineno        // /< the line number in which the problem originated
     104                                      const char *file, ///< the file in which the problem originated
     105                                      int lineno        ///< the line number in which the problem originated
    106106                                     );
    107107
     
    123123 */
    124124#    ifdef DOXYGEN
    125 void *psAlloc(size_t size       // /< Size required
     125void *psAlloc(size_t size       ///< Size required
    126126             );
    127127#    else
    128     void *p_psAlloc(size_t size,    // /< Size required
    129                     const char *file,       // /< File of call
    130                     int lineno      // /< Line number of call
     128
     129    void *p_psAlloc(size_t size,    ///< Size required
     130                    const char *file,       ///< File of call
     131                    int lineno      ///< Line number of call
    131132                   );
    132133
     
    144145 */
    145146#    ifdef DOXYGEN
    146 void *psRealloc(void *ptr       // /< Pointer to re-allocate
    147                 size_t size,    // /< Size required
     147void *psRealloc(void *ptr       ///< Pointer to re-allocate
     148                size_t size,    ///< Size required
    148149               );
    149150#    else
    150     void *p_psRealloc(void *ptr,    // /< Pointer to re-allocate
    151                       size_t size,  // /< Size required
    152                       const char *file,     // /< File of call
    153                       int lineno    // /< Line number of call
     151
     152    void *p_psRealloc(void *ptr,    ///< Pointer to re-allocate
     153                      size_t size,  ///< Size required
     154                      const char *file,     ///< File of call
     155                      int lineno    ///< Line number of call
    154156                     );
    155157
     
    164166 */
    165167#    ifdef DOXYGEN
    166 void psFree(void *ptr,          // /< Pointer to free, if NULL, function returns immediately.
     168void psFree(void *ptr,          ///< Pointer to free, if NULL, function returns immediately.
    167169           );
    168170#    else
    169     void p_psFree(void *ptr,        // /< Pointer to free
    170                   const char *file, // /< File of call
    171                   int lineno        // /< Line number of call
     171
     172    void p_psFree(void *ptr,        ///< Pointer to free
     173                  const char *file, ///< File of call
     174                  int lineno        ///< Line number of call
    172175                 );
    173176
     
    191194 *  @ingroup memTracing
    192195 */
    193 int psMemCheckLeaks(psMemoryId id0,     // /< don't list blocks with id < id0
    194                     psMemBlock *** arr, // /< pointer to array of pointers to leaked blocks, or NULL
    195                     FILE * fd   // /< print list of leaks to fd (or NULL)
     196int psMemCheckLeaks(psMemoryId id0,     ///< don't list blocks with id < id0
     197                    psMemBlock *** arr, ///< pointer to array of pointers to leaked blocks, or NULL
     198                    FILE * fd   ///< print list of leaks to fd (or NULL)
    196199                   );
    197200
     
    201204 *  @ingroup memTracing
    202205 */
    203 int psMemCheckCorruption(bool abort_on_error    // /< Abort on detecting corruption?
     206int psMemCheckCorruption(bool abort_on_error    ///< Abort on detecting corruption?
    204207                        );
    205208
     
    208211 *  @ingroup memRefCount
    209212 */
    210 psReferenceCount psMemGetRefCounter(void *vptr  // /< Pointer to get refCounter for
     213psReferenceCount psMemGetRefCounter(void *vptr  ///< Pointer to get refCounter for
    211214                                   );
    212215
     
    216219 */
    217220#    ifdef DOXYGEN
    218 void *psMemIncrRefCounter(void *vptr    // /< Pointer to increment refCounter, and return
     221void *psMemIncrRefCounter(void *vptr    ///< Pointer to increment refCounter, and return
    219222                         );
    220223#    else
    221     void *p_psMemIncrRefCounter(void *vptr, // /< Pointer to increment refCounter, and return
    222                                 const char *file,   // /< File of call
    223                                 int lineno  // /< Line number of call
     224
     225    void *p_psMemIncrRefCounter(void *vptr, ///< Pointer to increment refCounter, and return
     226                                const char *file,   ///< File of call
     227                                int lineno  ///< Line number of call
    224228                               );
    225229
     
    232236 */
    233237#    ifdef DOXYGEN
    234 void *psMemDecrRefCounter(void *vptr    // /< Pointer to decrement refCounter, and return
     238void *psMemDecrRefCounter(void *vptr    ///< Pointer to decrement refCounter, and return
    235239                         );
    236240#    else
    237     void *p_psMemDecrRefCounter(void *vptr, // /< Pointer to decrement refCounter, and return
    238                                 const char *file,   // /< File of call
    239                                 int lineno  // /< Line number of call
     241
     242    void *p_psMemDecrRefCounter(void *vptr, ///< Pointer to decrement refCounter, and return
     243                                const char *file,   ///< File of call
     244                                int lineno  ///< Line number of call
    240245                               );
    241246
     
    246251 *  @ingroup memCallback
    247252 */
    248 psMemProblemCallback psMemProblemCallbackSet(psMemProblemCallback func  // /< Function to run
     253psMemProblemCallback psMemProblemCallbackSet(psMemProblemCallback func  ///< Function to run
    249254                                            );
    250255
     
    253258 *  @ingroup memCallback
    254259 */
    255 psMemExhaustedCallback psMemExhaustedCallbackSet(psMemExhaustedCallback func    // /< Function to run
     260psMemExhaustedCallback psMemExhaustedCallbackSet(psMemExhaustedCallback func    ///< Function to run
    256261                                                );
    257262
     
    260265 *  @ingroup memCallback
    261266 */
    262 psMemAllocateCallback psMemAllocateCallbackSet(psMemAllocateCallback func       // /< Function to run
     267psMemAllocateCallback psMemAllocateCallbackSet(psMemAllocateCallback func       ///< Function to run
    263268                                              );
    264269
     
    267272 *  @ingroup memCallback
    268273 */
    269 psMemFreeCallback psMemFreeCallbackSet(psMemFreeCallback func   // /< Function to run
     274psMemFreeCallback psMemFreeCallbackSet(psMemFreeCallback func   ///< Function to run
    270275                                      );
    271276
     
    280285 *  @ingroup memCallback
    281286 */
    282 psMemoryId psMemAllocateCallbackSetID(psMemoryId id     // /< ID to set
     287psMemoryId psMemAllocateCallbackSetID(psMemoryId id     ///< ID to set
    283288                                     );
    284289
     
    287292 *  @ingroup memCallback
    288293 */
    289 psMemoryId psMemFreeCallbackSetID(psMemoryId id // /< ID to set
     294psMemoryId psMemFreeCallbackSetID(psMemoryId id ///< ID to set
    290295                                 );
    291296
Note: See TracChangeset for help on using the changeset viewer.