|  |  |  | Raptor RDF Syntax Parsing and Serializing Library Manual |  | 
|---|---|---|---|---|
| Top | Description | ||||
void raptor_free_memory (void *ptr); void* raptor_alloc_memory (size_t size); void* raptor_calloc_memory (size_t nmemb, size_t size);
Wrappers around the free, malloc and calloc functions but called from inside the library. Required by some systems to handle multiple-HEAPs and pass memory to and from the library.
void raptor_free_memory (void *ptr);
Free memory allocated inside raptor.
Some systems require memory allocated in a library to be deallocated in that library. This function allows memory allocated by raptor to be freed.
Examples include the result of the '_to_' methods that returns allocated memory such as raptor_uri_filename_to_uri_string, raptor_uri_filename_to_uri_string and raptor_uri_uri_string_to_filename_fragment
| 
 | memory pointer | 
void* raptor_alloc_memory (size_t size);
Allocate memory inside raptor.
Some systems require memory allocated in a library to be deallocated in that library. This function allows memory to be allocated inside the raptor shared library that can be freed inside raptor either internally or via raptor_free_memory.
Examples include using this in the raptor_parser_generate_id() handler
code to create new strings that will be used internally
as short identifiers and freed later on by the parsers.
| 
 | size of memory to allocate | 
| Returns : | the address of the allocated memory or NULL on failure | 
void* raptor_calloc_memory (size_t nmemb, size_t size);
Allocate zeroed array of items inside raptor.
Some systems require memory allocated in a library to be deallocated in that library. This function allows memory to be allocated inside the raptor shared library that can be freed inside raptor either internally or via raptor_free_memory.
Examples include using this in the raptor_parser_generate_id() handler
code to create new strings that will be used internally
as short identifiers and freed later on by the parsers.
| 
 | number of members | 
| 
 | size of item | 
| Returns : | the address of the allocated memory or NULL on failure |