Added memory allocation function getters (can't write generic function to parse with ownership transfer without them)

git-svn-id: http://pugixml.googlecode.com/svn/trunk@164 99668b35-9821-0410-8761-19e4c4f06640
This commit is contained in:
arseny.kapoulkine 2009-10-20 21:36:02 +00:00
parent a837271e9d
commit 327096ae0d
2 changed files with 26 additions and 0 deletions

View File

@ -3110,4 +3110,14 @@ namespace pugi
global_allocate = allocate; global_allocate = allocate;
global_deallocate = deallocate; global_deallocate = deallocate;
} }
allocation_function PUGIXML_FUNCTION get_memory_allocation_function()
{
return global_allocate;
}
deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function()
{
return global_deallocate;
}
} }

View File

@ -2001,6 +2001,22 @@ namespace pugi
* function you set via this function. * function you set via this function.
*/ */
void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate); void PUGIXML_FUNCTION set_memory_management_functions(allocation_function allocate, deallocation_function deallocate);
/**
* Get current memory allocation function
*
* \return memory allocation function
* \see set_memory_management_functions
*/
allocation_function PUGIXML_FUNCTION get_memory_allocation_function();
/**
* Get current memory deallocation function
*
* \return memory deallocation function
* \see set_memory_management_functions
*/
deallocation_function PUGIXML_FUNCTION get_memory_deallocation_function();
} }
// Inline implementation // Inline implementation