Lines Matching refs:Slot
69 typedef struct TYPENAME##Slot_s TYPENAME##Slot; \
74 TYPENAME##Slot* nextSlot; \
85 TYPENAME##Slot** slotTable; \
86 TYPENAME##Slot* slotFreeList; \
93 const TYPENAME##Slot* curSlot; \
220 TYPENAME##Slot* slot = hash->slotTable[slotNdx]; \
221 while (slot) \
223 TYPENAME##Slot* nextSlot = slot->nextSlot; \
224 slot->nextSlot = hash->slotFreeList; \
225 hash->slotFreeList = slot; \
226 slot->numUsed = 0; \
227 slot = nextSlot; \
234 TYPENAME##Slot* TYPENAME##_allocSlot (TYPENAME* hash) \
236 TYPENAME##Slot* slot; \
239 slot = hash->slotFreeList; \
243 slot = (TYPENAME##Slot*)deMemPool_alloc(hash->pool, sizeof(TYPENAME##Slot) * DE_HASH_ELEMENTS_PER_SLOT); \
245 if (slot) \
247 slot->nextSlot = DE_NULL; \
248 slot->numUsed = 0; \
251 return slot; \
259 TYPENAME##Slot** oldSlotTable = hash->slotTable; \
260 TYPENAME##Slot** newSlotTable = (TYPENAME##Slot**)deMemPool_alloc(hash->pool, sizeof(TYPENAME##Slot*) * (size_t)newSlotTableSize); \
278 TYPENAME##Slot* slot = oldSlotTable[slotNdx]; \
280 while (slot) \
283 for (elemNdx = 0; elemNdx < slot->numUsed; elemNdx++) \
286 if (!TYPENAME##_insert(hash, slot->keys[elemNdx], slot->values[elemNdx])) \
289 slot = slot->nextSlot; \
302 TYPENAME##Slot* slot = hash->slotTable[slotNdx]; \
305 while (slot) \
308 for (elemNdx = 0; elemNdx < slot->numUsed; elemNdx++) \
310 if (CMPFUNC(slot->keys[elemNdx], key)) \
311 return &slot->values[elemNdx]; \
313 slot = slot->nextSlot; \
323 TYPENAME##Slot* slot; \
333 slot = hash->slotTable[slotNdx]; \
335 if (!slot) \
337 slot = TYPENAME##_allocSlot(hash); \
338 if (!slot) return DE_FALSE; \
339 hash->slotTable[slotNdx] = slot; \
344 if (slot->numUsed == DE_HASH_ELEMENTS_PER_SLOT) \
346 if (slot->nextSlot) \
347 slot = slot->nextSlot; \
350 TYPENAME##Slot* nextSlot = TYPENAME##_allocSlot(hash); \
352 slot->nextSlot = nextSlot; \
353 slot = nextSlot; \
358 slot->keys[slot->numUsed] = key; \
359 slot->values[slot->numUsed] = value; \
360 slot->numUsed++; \
370 TYPENAME##Slot* slot; \
371 TYPENAME##Slot* prevSlot = DE_NULL; \
376 slot = hash->slotTable[slotNdx]; \
377 DE_ASSERT(slot); \
382 DE_ASSERT(slot->numUsed > 0); \
383 for (elemNdx = 0; elemNdx < slot->numUsed; elemNdx++) \
385 if (CMPFUNC(slot->keys[elemNdx], key)) \
387 TYPENAME##Slot* lastSlot = slot; \
394 slot->keys[elemNdx] = lastSlot->keys[lastSlot->numUsed-1]; \
395 slot->values[elemNdx] = lastSlot->values[lastSlot->numUsed-1]; \
414 prevSlot = slot; \
415 slot = slot->nextSlot; \
416 DE_ASSERT(slot); \
440 const HASHTYPENAME##Slot* slot = hash->slotTable[slotNdx]; \
441 while (slot) \
444 for (elemNdx = 0; elemNdx < slot->numUsed; elemNdx++) \
447 KEYARRAYTYPENAME##_set(keyArray, arrayNdx, slot->keys[elemNdx]); \
449 VALUEARRAYTYPENAME##_set(valueArray, arrayNdx, slot->values[elemNdx]); \
452 slot = slot->nextSlot; \