Changeset 2701

Show
Ignore:
Timestamp:
04/29/05 22:45:29 (4 years ago)
Author:
morris
Message:

Organize variable names.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ZankaAdditions/trunk/ZANotificationCenter.m

    r1749 r2701  
    6161         
    6262        ZANotificationCenterObserver                                    **chunks; 
    63         ZANotificationCenterObserver                                    *list; 
    64         unsigned int                                                                    count; 
    65         unsigned int                                                                    offset; 
     63        unsigned int                                                                    chunkCount; 
     64        unsigned int                                                                    chunkOffset; 
     65 
     66        ZANotificationCenterObserver                                    *freeList; 
    6667         
    6768        pthread_mutex_t                                                                 mutex; 
     
    126127        storage = (ZANotificationCenterStorage *) malloc(sizeof(ZANotificationCenterStorage)); 
    127128        memset(storage, 0, sizeof(ZANotificationCenterStorage)); 
    128         storage->offset = ZANotificationCenterZoneSize; 
     129        storage->chunkOffset = ZANotificationCenterZoneSize; 
    129130        pthread_mutex_init(&storage->mutex, NULL); 
    130131        ZANSNotificationCenterVars(self)->_pad[0] = (void *) storage; 
     
    162163        storage = ZANSNotificationCenterVars(self)->_pad[0]; 
    163164         
    164         for(i = 0; i < storage->count; i++) 
     165        for(i = 0; i < storage->chunkCount; i++) 
    165166                free(storage->chunks[i]); 
    166167         
     
    242243        size_t                                                  size; 
    243244         
    244         if(!storage->list) { 
    245                 if(storage->offset == ZANotificationCenterZoneSize) { 
    246                         storage->count++; 
    247                          
    248                         size = storage->count * sizeof(ZANotificationCenterObserver *); 
     245        if(!storage->freeList) { 
     246                if(storage->chunkOffset == ZANotificationCenterZoneSize) { 
     247                        storage->chunkCount++; 
     248                         
     249                        size = storage->chunkCount * sizeof(ZANotificationCenterObserver *); 
    249250                        storage->chunks = (ZANotificationCenterObserver **) 
    250251                                realloc(storage->chunks, size); 
    251252                         
    252253                        size = ZANotificationCenterZoneSize * sizeof(ZANotificationCenterObserver); 
    253                         storage->chunks[storage->count - 1] = (ZANotificationCenterObserver *) 
     254                        storage->chunks[storage->chunkCount - 1] = (ZANotificationCenterObserver *) 
    254255                                malloc(size); 
    255256                         
    256                         storage->offset = 0; 
     257                        storage->chunkOffset = 0; 
    257258                } 
    258259                 
    259                 observerBlock = storage->chunks[storage->count - 1]; 
    260                 storage->list = &observerBlock[storage->offset]; 
    261                 storage->offset++; 
    262                 storage->list->link = NULL; 
     260                observerBlock = storage->chunks[storage->chunkCount - 1]; 
     261                storage->freeList = &observerBlock[storage->chunkOffset++]; 
     262                storage->freeList->link = NULL; 
    263263        } 
    264264         
    265         observer = storage->list; 
    266         storage->list = observer->link; 
     265        observer = storage->freeList; 
     266        storage->freeList = observer->link; 
    267267 
    268268        return observer; 
     
    370370                                                storage->observers[index] = observer->next; 
    371371                                         
    372                                         observer->link = storage->list; 
    373                                         storage->list = observer; 
     372                                        observer->link = storage->freeList; 
     373                                        storage->freeList = observer; 
    374374                                } 
    375375                        } 
     
    394394                                                        storage->observers[i] = observer->next; 
    395395                                                 
    396                                                 observer->link = storage->list; 
    397                                                 storage->list = observer; 
     396                                                observer->link = storage->freeList; 
     397                                                storage->freeList = observer; 
    398398                                        } 
    399399                                }