for (PRInt32 j=wallet_NextAllocSlot; j<kAllocBlockElems; j++) { mapElementPtr = NS_STATIC_CAST(wallet_MapElement*, (wallet_MapElementAllocations_list)->ElementAt(count-1)); mapElementPtr[j].item1 = nsnull; mapElementPtr[j].item2 = nsnull; mapElementPtr[j].itemList = nsnull; }
wallet_DeallocateMapElements() {  wallet_MapElement * mapElementPtr;  PRInt32 count = LIST_COUNT(wallet_MapElementAllocations_list);  // initialize remainder of last allocated block so we don't crash on []delete  for (PRInt32 j=wallet_NextAllocSlot; j<kAllocBlockElems; j++) {    mapElementPtr =      NS_STATIC_CAST(wallet_MapElement*,                     (wallet_MapElementAllocations_list)->ElementAt(count-1));    mapElementPtr[j].item1 = nsnull;    mapElementPtr[j].item2 = nsnull;    mapElementPtr[j].itemList = nsnull;  }  for (PRInt32 i=count-1; i>=0; i--) {    mapElementPtr =      NS_STATIC_CAST(wallet_MapElement*, (wallet_MapElementAllocations_list)->ElementAt(i));    delete [] mapElementPtr;  }    delete wallet_MapElementAllocations_list;  wallet_MapElementAllocations_list = nsnull;  wallet_NextAllocSlot = kAllocBlockElems;}