The odp_buffer_pool_create function has a return code that defaults
to ODP_BUFFER_POOL_INVALID, although the API header file doxygen comment
does not indicate that there is any error return code possible.
I was going to add that information however there truly is no error
returned because link_bufs actually calls exit(0) on error.
My question is do we update odp_buffer_pool_create docs to say this
function may never return, or should link_bufs be rewritten ?
I would normally say we need to remove the exit(0) but presumably this was
done as as an optimization ? In which case we just need to document it
properly ?
Thoughts ?
odp_buffer_pool_t odp_buffer_pool_create(const char *name,
void *base_addr, uint64_t size,
size_t buf_size, size_t buf_align,
int buf_type)
{
odp_buffer_pool_t i;
pool_entry_t *pool;
odp_buffer_pool_t pool_id = ODP_BUFFER_POOL_INVALID;
for (i = 0; i < ODP_CONFIG_BUFFER_POOLS; i++) {
pool = get_pool_entry(i);
LOCK(&pool->s.lock);
if (pool->s.buf_base == 0) {
/* found free pool */
strncpy(pool->s.name, name,
ODP_BUFFER_POOL_NAME_LEN - 1);
pool->s.name[ODP_BUFFER_POOL_NAME_LEN - 1] = 0;
pool->s.pool_base_addr = base_addr;
pool->s.pool_size = size;
pool->s.user_size = buf_size;
pool->s.user_align = buf_align;
pool->s.buf_type = buf_type;
link_bufs(pool); NEVER returns on some errors
UNLOCK(&pool->s.lock);
pool_id = i;
break;
}
UNLOCK(&pool->s.lock);
}
return pool_id;
}
--
*Mike Holmes*
Linaro Technical Manager / Lead
LNG - ODP
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp