IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 9, 2004, 1:34:58 PM (22 years ago)
Author:
desonia
Message:

cleanup of some indent-induced madness.

File:
1 edited

Legend:

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

    r1407 r1440  
    99*  @author Robert Lupton, Princeton University
    1010*
    11 *  @version $Revision: 1.33 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-08-07 00:06:06 $
     11*  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
     12*  @date $Date: 2004-08-09 23:34:58 $
    1313*
    1414*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3131#define P_PS_LARGE_BLOCK_SIZE 65536        // size where under, we try to recycle
    3232
    33 static int checkMemBlock(const psMemBlock * m, const char *funcName);
    34 static psMemBlock *lastMemBlockAllocated = NULL;
     33static int checkMemBlock(const psMemBlock* m, const char *funcName);
     34static psMemBlock* lastMemBlockAllocated = NULL;
    3535static pthread_mutex_t memBlockListMutex = PTHREAD_MUTEX_INITIALIZER;
    3636static pthread_mutex_t memIdMutex = PTHREAD_MUTEX_INITIALIZER;
     
    4444
    4545// N.B. recycleBinSize should be terminated by P_PS_LARGE_BLOCK_SIZE (simplifies search loops)
    46 static psMemBlock *recycleMemBlockList[13] = {
     46static psMemBlock* recycleMemBlockList[13] = {
    4747            NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
    4848        };
    4949
    5050#ifdef PS_MEM_DEBUG
    51 static psMemBlock *deadBlockList;       // a place to put dead memBlocks in debug mode.
     51static psMemBlock* deadBlockList;       // a place to put dead memBlocks in debug mode.
    5252#endif
    5353
     
    6969    while (level >= 0 && ptr == NULL) {
    7070        while (recycleMemBlockList[level] != NULL && ptr == NULL) {
    71             psMemBlock *old = recycleMemBlockList[level];
     71            psMemBlock* old = recycleMemBlockList[level];
    7272
    7373            recycleMemBlockList[level] = recycleMemBlockList[level]->nextBlock;
     
    9797}
    9898
    99 static void memProblemCallbackDefault(const psMemBlock * ptr, const char *file, int lineno)
     99static void memProblemCallbackDefault(const psMemBlock* ptr, const char *file, int lineno)
    100100{
    101101    if (ptr->refCounter < 1) {
     
    156156 * isn't resignalled)
    157157 */
    158 static psMemoryId memAllocateCallbackDefault(const psMemBlock * ptr)
     158static psMemoryId memAllocateCallbackDefault(const psMemBlock* ptr)
    159159{
    160160    static psMemoryId incr = 0; // "p_psMemAllocateID += incr"
     
    163163}
    164164
    165 static psMemoryId memFreeCallbackDefault(const psMemBlock * ptr)
     165static psMemoryId memFreeCallbackDefault(const psMemBlock* ptr)
    166166{
    167167    static psMemoryId incr = 0; // "p_psMemFreeID += incr"
     
    222222 */
    223223
    224 static int checkMemBlock(const psMemBlock * m, const char *funcName)
     224static int checkMemBlock(const psMemBlock* m, const char *funcName)
    225225{
    226226    // n.b. since this is called by psMemCheckCorruption while the memblock list is mutex locked,
     
    257257    pthread_mutex_lock(&memBlockListMutex);
    258258
    259     for (psMemBlock * iter = lastMemBlockAllocated; iter != NULL; iter = iter->nextBlock) {
     259    for (psMemBlock* iter = lastMemBlockAllocated; iter != NULL; iter = iter->nextBlock) {
    260260        if (checkMemBlock(iter, __func__)) {
    261261            nbad++;
     
    280280{
    281281
    282     psMemBlock *ptr = NULL;
     282    psMemBlock* ptr = NULL;
    283283
    284284    // memory is of the size I want to bother recycling?
     
    327327    // increment the memory id safely.
    328328    pthread_mutex_lock(&memBlockListMutex);
    329     *(psMemoryId *) & ptr->id = ++memid;
     329    *(psMemoryId* ) & ptr->id = ++memid;
    330330    pthread_mutex_unlock(&memBlockListMutex);
    331331
     
    363363        return p_psAlloc(size, file, lineno);
    364364    } else {
    365         psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
     365        psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    366366        bool isBlockLast = false;
    367367
     
    376376        isBlockLast = (ptr == lastMemBlockAllocated);
    377377
    378         ptr = (psMemBlock *) realloc(ptr, sizeof(psMemBlock) + size + sizeof(void *));
     378        ptr = (psMemBlock* ) realloc(ptr, sizeof(psMemBlock) + size + sizeof(void *));
    379379
    380380        if (ptr == NULL) {
     
    415415 * Check for memory leaks.
    416416 */
    417 int psMemCheckLeaks(psMemoryId id0, psMemBlock *** arr, FILE * fd)
     417int psMemCheckLeaks(psMemoryId id0, psMemBlock* ** arr, FILE * fd)
    418418{
    419419    int nleak = 0;
    420420    int j = 0;
    421     psMemBlock *topBlock = lastMemBlockAllocated;
     421    psMemBlock* topBlock = lastMemBlockAllocated;
    422422
    423423    pthread_mutex_lock(&memBlockListMutex);
    424424
    425     for (psMemBlock * iter = topBlock; iter != NULL; iter = iter->nextBlock) {
     425    for (psMemBlock* iter = topBlock; iter != NULL; iter = iter->nextBlock) {
    426426        if ((psMemGetRefCounter(iter + 1) > 0) && (iter->id >= id0)) {
    427427            nleak++;
     
    446446    pthread_mutex_lock(&memBlockListMutex);
    447447
    448     for (psMemBlock * iter = topBlock; iter != NULL; iter = iter->nextBlock) {
     448    for (psMemBlock* iter = topBlock; iter != NULL; iter = iter->nextBlock) {
    449449        if ((psMemGetRefCounter(iter + 1) > 0) && (iter->id >= id0)) {
    450450            (*arr)[j++] = iter;
     
    466466psReferenceCount psMemGetRefCounter(void *vptr)
    467467{
    468     psMemBlock *ptr;
     468    psMemBlock* ptr;
    469469    unsigned int refCount;
    470470
     
    473473    }
    474474
    475     ptr = ((psMemBlock *) vptr) - 1;
     475    ptr = ((psMemBlock* ) vptr) - 1;
    476476
    477477    if (checkMemBlock(ptr, __func__) != 0) {
     
    489489void *p_psMemIncrRefCounter(void *vptr, const char *file, int lineno)
    490490{
    491     psMemBlock *ptr;
     491    psMemBlock* ptr;
    492492
    493493    if (vptr == NULL) {
     
    495495    }
    496496
    497     ptr = ((psMemBlock *) vptr) - 1;
     497    ptr = ((psMemBlock* ) vptr) - 1;
    498498
    499499    if (checkMemBlock(ptr, __func__)) {
     
    515515    }
    516516
    517     psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
     517    psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    518518
    519519    if (checkMemBlock(ptr, __func__) != 0) {
     
    607607    }
    608608
    609     psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
     609    psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    610610
    611611    if (checkMemBlock(ptr, __func__) != 0) {
     
    622622    }
    623623
    624     psMemBlock *ptr = ((psMemBlock *) vptr) - 1;
     624    psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
    625625
    626626    if (checkMemBlock(ptr, __func__) != 0) {
Note: See TracChangeset for help on using the changeset viewer.