MCPcopy Create free account
hub / github.com/MyGUI/mygui / deallocate_memory

Method deallocate_memory

Tools/EditorFramework/pugixml.cpp:382–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

380 }
381
382 void deallocate_memory(void* ptr, size_t size, xml_memory_page* page)
383 {
384 if (page == _root)
385 page->busy_size = _busy_size;
386
387 assert(ptr >= page->data && ptr < page->data + page->busy_size);
388 (void)!ptr;
389
390 page->freed_size += size;
391 assert(page->freed_size <= page->busy_size);
392
393 if (page->freed_size == page->busy_size)
394 {
395 if (page->next == 0)
396 {
397 assert(_root == page);
398
399 // top page freed, just reset sizes
400 page->busy_size = page->freed_size = 0;
401 _busy_size = 0;
402 }
403 else
404 {
405 assert(_root != page);
406 assert(page->prev);
407
408 // remove from the list
409 page->prev->next = page->next;
410 page->next->prev = page->prev;
411
412 // deallocate
413 deallocate_page(page);
414 }
415 }
416 }
417
418 char_t* allocate_string(size_t length)
419 {

Callers 2

destroy_attributeFunction · 0.45
destroy_nodeFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected