libowfat_iarray_allocate man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

iarray_allocate(3)					    iarray_allocate(3)

NAME
       iarray_allocate - get pointer to nth element in iarray

SYNTAX
       #include <iarray.h>

       void* iarray_allocate(iarray* x, size_t pos);

	 iarray x;
	 size_t pos;
	 t* p = iarray_allocate(&x,pos);

DESCRIPTION
       iarray_allocate	is similar to iarray_get, but if the requested element
       is not in the array, the array will be resized.	If the	resize	fails,
       iarray_allocate returns NULL and leaves the array untouched.

       This function is safe to use in environments with multiple threads, but
       it can block for indeterminate time if other threads  are  reallocating
       the array at the same time.

       Note  that  it is safe to use iarray_allocate where you would otherwise
       use iarray_get.	The only reason to use iarray_get over iarray_allocate
       would be optimization.

RETURN VALUE
       Return a pointer to the requested element.  If there was a memory allo‐
       cation failure, returns NULL.

SEE ALSO
       iarray_init(3), iarray_get(3), iarray_free(3)

							    iarray_allocate(3)
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net