Index: src/axl_decl.c =================================================================== --- src/axl_decl.c (revision 3129) +++ src/axl_decl.c (working copy) @@ -40,6 +40,34 @@ /** + * @brief Calloc helper for axl library. + * + * @param count How many items to allocate. + * @param size Size of one item. + * + * @return A newly allocated pointer. + * @see axl_free + */ +axlPointer axl_calloc(size_t count, size_t size) +{ + return calloc(count, size); +} + +/** + * @brief Realloc helper for axl library. + * + * @param ref the reference to reallocate. + * @param size Size of the new reference. + * + * @return A newly allocated pointer. + * @see axl_free + */ +axlPointer axl_realloc(axlPointer ref, size_t size) +{ + return realloc(ref, size); +} + +/** * @brief Allows to deallocate memory referenced by ref but * checking before that the reference is different from null. * Index: src/axl_decl.h =================================================================== --- src/axl_decl.h (revision 3129) +++ src/axl_decl.h (working copy) @@ -767,7 +767,29 @@ AxlDebugLevel; /** - * @brief Support macro to allocate memory using the calloc function, + * @brief Calloc helper for axl library. + * + * @param count How many items to allocate. + * @param size Size of one item. + * + * @return A newly allocated pointer. + * @see axl_free + */ +axlPointer axl_calloc(size_t count, size_t size); + +/** + * @brief Realloc helper for axl library. + * + * @param ref the reference to reallocate. + * @param size Size of the new reference. + * + * @return A newly allocated pointer. + * @see axl_free + */ +axlPointer axl_realloc(axlPointer ref, size_t size); + +/** + * @brief Support macro to allocate memory using axl_calloc function, * making a casting and using the sizeof keyword. * * @param type The type to allocate @@ -775,7 +797,7 @@ * * @return A newly allocated pointer. */ -#define axl_new(type, count) (type *) calloc (count, sizeof (type)) +#define axl_new(type, count) (type *) axl_calloc (count, sizeof (type)) /** * @brief Free the provided pointer that was allocated using \ref Index: src/axl_factory.c =================================================================== --- src/axl_factory.c (revision 3129) +++ src/axl_factory.c (working copy) @@ -71,7 +71,7 @@ result->step = 256 / size_of_type; result->block = axl_new (axlItemBlock, 1); - result->block->items = calloc (result->step, size_of_type); + result->block->items = axl_calloc (result->step, size_of_type); return result; @@ -102,7 +102,7 @@ factory->step = 2048 / factory->type_size; block = axl_new (axlItemBlock, 1); - block->items = calloc (factory->step, factory->type_size); + block->items = axl_calloc (factory->step, factory->type_size); factory->count = 1; block->next = factory->block; Index: src/libaxl.def =================================================================== --- src/libaxl.def (revision 3129) +++ src/libaxl.def (working copy) @@ -77,6 +77,7 @@ __axl_stack_foreach_common __axl_stream_common_to __axl_stream_get_untilv_wide +axl_calloc axl_casecmp axl_cmp axl_doc_add_pi_target @@ -358,6 +359,7 @@ axl_pi_get_content axl_pi_get_name axl_pi_get_size +axl_realloc axl_stack_foreach axl_stack_foreach3 axl_stack_free