miscellaneous/motionbuilder_shelf/module/pugixml/docs/samples/custom_memory_management.cpp
#include "pugixml.hpp"
#include <new>
void* custom_allocate(
size_t size)
{
return new (std::nothrow) char[size];
}
void custom_deallocate(
void*
ptr)
{
delete[]
static_cast<char*
>(
ptr);
}
int main()
{
pugi::set_memory_management_functions(custom_allocate, custom_deallocate);
doc.load_string("<node/>");
}