<libroxml  version="3.0.2" />
contact: tristan.lelong@libroxml.net
Functions | Variables
roxml_mem.c File Reference

XML internal memory management module. More...

#include <stdlib.h>
#include "roxml_mem.h"

Go to the source code of this file.

Functions

ROXML_STATIC ROXML_INT void roxml_release_last (void *data)
 
ROXML_STATIC ROXML_INT void roxml_release_all (void *data)
 
ROXML_STATIC ROXML_INT void roxml_release_pointer (void *data)
 
ROXML_API void roxml_release (void *data)
 memory cleanning function More...
 
ROXML_INT void * roxml_malloc (int size, int num, int type)
 alloc memory function More...
 

Variables

memory_cell_t head_cell = { PTR_NONE, 0, NULL, 0, NULL, NULL }
 head of memory manager
 

Detailed Description

XML internal memory management module.

(C) Copyright 2014 Tristan Lelong trist.nosp@m.an.l.nosp@m.elong.nosp@m.@lib.nosp@m.roxml.nosp@m..net

SPDX-Licence-Identifier: LGPL-2.1+ The author added a static linking exception, see License.txt.

Definition in file roxml_mem.c.

Function Documentation

◆ roxml_malloc()

roxml_malloc ( int  size,
int  num,
int  type 
)

alloc memory function

this function allocate some memory that will be reachable at any time by libroxml memory manager

Parameters
sizethe size of memory to allocate for each elem
numthe number of element
typethe kind of pointer

Definition at line 124 of file roxml_mem.c.

◆ roxml_release()

ROXML_API void roxml_release ( void *  data)

memory cleanning function

This function release the memory pointed by pointer just like free would but for memory allocated with roxml_malloc. Freeing a NULL pointer won't do anything. roxml_release also allow you to remove all previously allocated memory by using RELEASE_ALL as argument. You can also safely use RELEASE_LAST argument that will release the previously allocated varable within the current thread (making this function thread safe). if using roxml_release on a variable non roxml_mallocated, nothing will happen (ie variable won't be freed)

Parameters
datathe pointer to delete or NULL or RELEASE_ALL or RELEASE_LAST
Returns
void

Definition at line 109 of file roxml_mem.c.