[PATCH] Introduce xmalloc, memory allocator with die_out_of_memory()
Dmitry V. Levin
ldv at altlinux.org
Fri Mar 20 10:30:42 UTC 2015
On Fri, Mar 20, 2015 at 02:53:39PM +0900, Masatake YAMATO wrote:
> In strace following code sentences are frequently used:
>
> var = malloc(fdsize);
> if (!var)
> die_out_of_memory();
>
> This patch introduces xmalloc and friends which simplify
> above sentences like:
>
> var = xmalloc(fdsize);
>
> Here friends are xcalloc and xrealloc.
Do we need xrealloc in its classic form, or rather an edition
with an integer overflow check?
--
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20150320/45c54a3c/attachment.bin>
More information about the Strace-devel
mailing list