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

Method ExpandUnits

Libraries/unrar/suballoc.cpp:257–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255
256
257void* SubAllocator::ExpandUnits(void* OldPtr,int OldNU)
258{
259 int i0=Units2Indx[OldNU-1], i1=Units2Indx[OldNU-1+1];
260 if (i0 == i1)
261 return OldPtr;
262 void* ptr=AllocUnits(OldNU+1);
263 if ( ptr )
264 {
265 memcpy(ptr,OldPtr,U2B(OldNU));
266 InsertNode(OldPtr,i0);
267 }
268 return ptr;
269}
270
271
272void* SubAllocator::ShrinkUnits(void* OldPtr,int OldNU,int NewNU)

Callers 1

UpdateModelMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected