MCPcopy Create free account
hub / github.com/WheretIB/nullc / deallocate_memory

Method deallocate_memory

external/pugixml/pugixml.cpp:282–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280 }
281
282 void deallocate_memory(void* ptr, size_t size, xml_memory_page* page)
283 {
284 if (page == _root) page->busy_size = _busy_size;
285
286 assert(ptr >= page->data && ptr < page->data + page->busy_size);
287 (void)!ptr;
288
289 page->freed_size += size;
290 assert(page->freed_size <= page->busy_size);
291
292 if (page->freed_size == page->busy_size)
293 {
294 if (page->next == 0)
295 {
296 assert(_root == page);
297
298 // top page freed, just reset sizes
299 page->busy_size = page->freed_size = 0;
300 _busy_size = 0;
301 }
302 else
303 {
304 assert(_root != page);
305 assert(page->prev);
306
307 // remove from the list
308 page->prev->next = page->next;
309 page->next->prev = page->prev;
310
311 // deallocate
312 deallocate_page(page);
313 }
314 }
315 }
316
317 char_t* allocate_string(size_t length)
318 {

Callers 2

destroy_attributeFunction · 0.80
destroy_nodeFunction · 0.80

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected