IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 13, 2006, 11:13:48 AM (20 years ago)
Author:
Paul Price
Message:

Synchronising with SDRS, and cleaning up:

  • Replaced is_psType() with PS_ASSERT_PTR() throughout psLib.
  • Changed "char *" to "psString" where appropriate in psDB and a few other places (to indicate pointers on the PS memory system).
  • Removed psLogArguments and psTraceArguments (functionality in psArgumentVerbosity).
  • Renamed psMetadataLookupMD to psMetadataLookupMetadata (it was about time...). Similarly with the psPolynomial?D{From,To}MD functions.
  • Removed psMetadataRemove() since it is ambiguous about what's removed --- use psMetadataRemove{Key,Index}.
  • psArrayRemoveByPos --> psArrayRemoveIndex
  • psArrayRemove --> psArrayRemoveData
File:
1 edited

Legend:

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

    r8812 r9538  
    88*  @author Robert Lupton, Princeton University
    99*
    10 *  @version $Revision: 1.85 $ $Name: not supported by cvs2svn $
    11 *  @date $Date: 2006-09-14 22:27:29 $
     10*  @version $Revision: 1.86 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2006-10-13 21:13:48 $
    1212*
    1313*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    2424#include "psMemory.h"
    2525#include "psError.h"
     26#include "psAssert.h"
    2627#include "psAbort.h"
    2728#include "psLogMsg.h"
     
    3536#include "psLine.h"
    3637#include "psRegion.h"
    37 
    38 #define P_PS_MEMMAGIC (psPtr )0xdeadbeef   // Magic number in psMemBlock header
    3938
    4039#define P_PS_LARGE_BLOCK_SIZE 65536        // size where under, we try to recycle
     
    274273psMemId psMemGetId(void)
    275274{
    276     psMemId id;
    277 
    278     if (safeThreads) {
    279         pthread_mutex_lock(&memIdMutex);
    280     }
    281 
    282     id = memid + 1;
    283 
    284     if (safeThreads) {
    285         pthread_mutex_unlock(&memIdMutex);
    286     }
    287 
    288     return id;
     275    return psMemGetLastId() + 1;
    289276}
    290277
     
    889876}
    890877
    891 bool is_psType(psPtr ptr)
    892 {
    893     if (ptr == NULL) {
    894         return false;
    895     }
    896     psMemBlock* m = ((psMemBlock* ) ptr) - 1;
    897     if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) {
    898         return false; //Probably not a psAllocated-Type
    899     } else {
    900         return true;
    901     }
    902 }
    903 
    904878bool psMemCheckType(psDataType type,
    905879                    psPtr ptr)
    906880{
    907     if (!is_psType(ptr)) {
    908         return false;
    909     }
     881    PS_ASSERT_PTR(ptr, false);
    910882
    911883    switch(type) {
Note: See TracChangeset for help on using the changeset viewer.