Mercurial > molko
view man/mlk_alloc_new.3 @ 449:f2f0e73ea9da
core: drawable -> mlk_drawable
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 18 Feb 2023 13:16:40 +0100 |
parents | 9c3b3935f0aa |
children |
line wrap: on
line source
.Dd $Mdocdate$ .Dt MLK_ALLOC_NEW 3 .Os .Sh NAME .Nm mlk_alloc_new , .Nm mlk_alloc_new0 , .Nm mlk_alloc_renew , .Nm mlk_alloc_renew0 .Nd allocate memory .Sh LIBRARY libmlk-core (-lmlk-core) .Sh SYNOPSIS .In mlk/core/alloc.h .Ft void * .Fn mlk_alloc_new "size_t size" .Ft void * .Fn mlk_alloc_new0 "size_t size" .Ft void * .Fn mlk_alloc_renew "void *ptr, size_t size" .Ft void * .Fn mlk_alloc_renew0 "void *ptr, size_t oldsize, size_t newsize" .Sh DESCRIPTION .Pp The .Fn mlk_alloc_new and .Fn mlk_alloc_new0 functions allocate memory data of the given .Fa size . The .Fn mlk_alloc_new0 variant ensure the data is being zero-initialized. .Pp The .Fn mlk_alloc_renew function reallocates the pointer .Fa ptr according to its .Fa size . .Pp The .Fn mlk_alloc_renew0 function is similar to .Fn mlk_alloc_renew but zero-initialize the memory. It needs the previous size given in .Fa oldsize argument because the function would not know which memory region to zero initialize when increasing the memory. .Sh RETURN VALUES All functions return a pointer to the memory according to the current allocation strategy. .Sh SEE ALSO .Xr mlk-alloc 3 , .Xr mlk_alloc_set 3 .Sh AUTHORS .An David Demelier Aq Mt markand@malikania.fr .