/* first block allocation */
- if((errno = resize(allocator)))
+ if(resize(allocator))
{
free(allocator);
return NULL;
int pos, node_size;
fn_finalize_t fn_finalize;
void* type;
+ int rv;
if(!(*allocator_ptr))
return EINVAL;
/* apply the fn_finalize function to the first type */
- if((errno = (*fn_finalize)(&type)))
- return errno;
+ if((rv = (*fn_finalize)(&type)))
+ return rv;
}
/*clear all the other types */
/* apply the fn_finalize function to the first type */
- if((errno = (*fn_finalize)(&type)))
- return errno;
+ if((rv = (*fn_finalize)(&type)))
+ return rv;
}
}
int
allocator_dealloc(allocator_t allocator, void* block)
{
+ int rv;
allocator_node_t node;
if(!allocator || !block)
if(allocator->fn_finalize)
{
- if((errno = (*(allocator->fn_finalize))(&block)))
- return errno;
+ if((rv = (*(allocator->fn_finalize))(&block)))
+ return rv;
memset(block, 0, allocator->type_size);
node->is_allocated = 0;
fn_finalize_t fn_finalize;
void* type;
register int pos;
+ int rv;
if(!allocator)
/* apply the fn_finalize function to the first type */
- if((errno = (*fn_finalize)(&type)))
- return errno;
+ if((rv = (*fn_finalize)(&type)))
+ return rv;
memset(type, 0, type_size);
node->is_allocated = 0;
/* apply the fn_finalize function to the first type */
- if((errno = (*fn_finalize)(&type)))
- return errno;
+ if((rv = (*fn_finalize)(&type)))
+ return rv;
memset(type, 0, type_size);
node->is_allocated = 0;