1 /* Division by powers of two.
5 typedef unsigned int UINT;
7 typedef struct _HeapEntryState
13 static HeapEntryState *_getHeapEntryState(void *p, HeapEntryState *pStates, UINT nStateEntries)
15 int uLeft = -1, uRight = nStateEntries, uMiddle;
17 while (uRight - uLeft > 1)
21 uMiddle = (uLeft + uRight)/2;
22 iDiff = pStates[uMiddle].pBase - p;
34 return pStates + uMiddle;