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

Method deallocate_string

external/pugixml/pugixml.cpp:343–356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341 }
342
343 void deallocate_string(char_t* string)
344 {
345 // get header
346 xml_memory_string_header* header = reinterpret_cast<xml_memory_string_header*>(string) - 1;
347
348 // deallocate
349 size_t page_offset = offsetof(xml_memory_page, data) + header->page_offset;
350 xml_memory_page* page = reinterpret_cast<xml_memory_page*>(reinterpret_cast<char*>(header) - page_offset);
351
352 // if full_size == 0 then this string occupies the whole page
353 size_t full_size = header->full_size == 0 ? page->busy_size : header->full_size;
354
355 deallocate_memory(header, full_size, page);
356 }
357
358 xml_memory_page* _root;
359 size_t _busy_size;

Callers 3

destroy_attributeFunction · 0.80
destroy_nodeFunction · 0.80
strcpy_insituFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected