IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Feb 6, 2007, 2:36:02 PM (19 years ago)
Author:
jhoblitt
Message:

remove all use of psType.h types -- psMemory.h now has no ps*.h dependencies
remove "const void *" functions parameters because of sporadic compilation warnings

File:
1 edited

Legend:

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

    r11617 r11672  
    1010*  @author Joshua Hoblitt, University of Hawaii
    1111*
    12 *  @version $Revision: 1.92 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2007-02-03 05:54:08 $
     12*  @version $Revision: 1.93 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2007-02-07 00:36:02 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    109109 *  Default memExhausted callback.
    110110 */
    111 static psPtr memExhaustedCallbackDefault(size_t size)
     111static void *memExhaustedCallbackDefault(size_t size)
    112112{
    113113    return NULL;
     
    403403 * Actually allocate memory
    404404 */
    405 psPtr p_psAlloc(size_t size,
     405void *p_psAlloc(size_t size,
    406406                const char *file,
    407407                unsigned int lineno,
     
    409409{
    410410
    411     psMemBlock *memBlock = malloc(sizeof(psMemBlock) + size + sizeof(psPtr));
     411    psMemBlock *memBlock = malloc(sizeof(psMemBlock) + size + sizeof(void *));
    412412    if (memBlock == NULL) {
    413413        MUTEX_LOCK(&memBlockListMutex);
     
    490490}
    491491
    492 psPtr p_psRealloc(psPtr ptr,
     492void *p_psRealloc(void *ptr,
    493493                  size_t size,
    494494                  const char *file,
     
    516516    bool isBlockLast = (memBlock == lastMemBlockAllocated);
    517517
    518     memBlock = (psMemBlock *)realloc(memBlock, sizeof(psMemBlock) + size + sizeof(psPtr));
     518    memBlock = (psMemBlock *)realloc(memBlock, sizeof(psMemBlock) + size + sizeof(void *));
    519519    if (memBlock== NULL) {
    520520        MUTEX_LOCK(&memBlockListMutex);
     
    680680
    681681// return refCounter
    682 psReferenceCount p_psMemGetRefCounter(const psPtr ptr,
     682psReferenceCount p_psMemGetRefCounter(void *ptr,
    683683                                      const char *file,
    684684                                      unsigned int lineno,
     
    697697
    698698// increment and return refCounter
    699 psPtr p_psMemIncrRefCounter(const psPtr ptr,
     699void *p_psMemIncrRefCounter(void *ptr,
    700700                            const char *file,
    701701                            unsigned int lineno,
     
    723723
    724724#if 0
    725 psPtr p_psMemSetRefCounter(psPtr vptr,
    726                            psReferenceCount count,
    727                            const char *file,
    728                            psS32 lineno)
     725void * p_psMemSetRefCounter(void * vptr,
     726                            psReferenceCount count,
     727                            const char *file,
     728                            psS32 lineno)
    729729{
    730730    psMemBlock* ptr;
     
    756756
    757757// decrement and return refCounter
    758 psPtr p_psMemDecrRefCounter(psPtr ptr,
     758void *p_psMemDecrRefCounter(void * ptr,
    759759                            const char *file,
    760760                            unsigned int lineno,
     
    823823}
    824824
    825 void p_psMemSetDeallocator(psPtr ptr,
     825void p_psMemSetDeallocator(void *ptr,
    826826                           psFreeFunc freeFunc,
    827827                           const char *file,
     
    840840}
    841841
    842 psFreeFunc p_psMemGetDeallocator(const psPtr ptr,
     842psFreeFunc p_psMemGetDeallocator(void *ptr,
    843843                                 const char *file,
    844844                                 unsigned int lineno,
     
    879879}
    880880
    881 bool p_psMemGetPersistent(psPtr ptr,
     881bool p_psMemGetPersistent(void *ptr,
    882882                          const char *file,
    883883                          unsigned int lineno,
     
    895895}
    896896
    897 void p_psMemSetPersistent(psPtr ptr,
     897void p_psMemSetPersistent(void *ptr,
    898898                          bool value,
    899899                          const char *file,
     
    924924                  size_t *persistent) // persistent memory that's currently allocated
    925925{
    926     const size_t overhead = sizeof(psMemBlock) + sizeof(psPtr); // overhead on each allocation
     926    const size_t overhead = sizeof(psMemBlock) + sizeof(void *); // overhead on each allocation
    927927
    928928    if (print) {
Note: See TracChangeset for help on using the changeset viewer.