| 199 | } |
| 200 | |
| 201 | void* SubAllocator::AllocUnitsRare(int indx) |
| 202 | { |
| 203 | if ( !GlueCount ) |
| 204 | { |
| 205 | GlueCount = 255; |
| 206 | GlueFreeBlocks(); |
| 207 | if ( FreeList[indx].next ) |
| 208 | return RemoveNode(indx); |
| 209 | } |
| 210 | int i=indx; |
| 211 | do |
| 212 | { |
| 213 | if (++i == N_INDEXES) |
| 214 | { |
| 215 | GlueCount--; |
| 216 | i=U2B(Indx2Units[indx]); |
| 217 | int j=FIXED_UNIT_SIZE*Indx2Units[indx]; |
| 218 | if (FakeUnitsStart - pText > j) |
| 219 | { |
| 220 | FakeUnitsStart -= j; |
| 221 | UnitsStart -= i; |
| 222 | return UnitsStart; |
| 223 | } |
| 224 | return NULL; |
| 225 | } |
| 226 | } while ( !FreeList[i].next ); |
| 227 | void* RetVal=RemoveNode(i); |
| 228 | SplitBlock(RetVal,i,indx); |
| 229 | return RetVal; |
| 230 | } |
| 231 | |
| 232 | |
| 233 | inline void* SubAllocator::AllocUnits(int NU) |
nothing calls this directly
no outgoing calls
no test coverage detected