MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / AllocUnitsRare

Method AllocUnitsRare

Libraries/unrar/suballoc.cpp:201–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

199}
200
201void* 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
233inline void* SubAllocator::AllocUnits(int NU)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected