source: icGREP/icgrep-devel/icgrep/combine/pugixml/docs/samples/custom_memory_management.cpp @ 5516

Last change on this file since 5516 was 5516, checked in by faldebey, 21 months ago

added combinatorial testing tool

File size: 425 bytes
Line 
1#include "pugixml.hpp"
2
3#include <new>
4
5// tag::decl[]
6void* custom_allocate(size_t size)
7{
8    return new (std::nothrow) char[size];
9}
10
11void custom_deallocate(void* ptr)
12{
13    delete[] static_cast<char*>(ptr);
14}
15// end::decl[]
16
17int main()
18{
19// tag::call[]
20    pugi::set_memory_management_functions(custom_allocate, custom_deallocate);
21// end::call[]
22
23    pugi::xml_document doc;
24    doc.load_string("<node/>");
25}
26
27// vim:et
Note: See TracBrowser for help on using the repository browser.