This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Checking that a memory area is empty
- From: Rich Felker <dalias at aerifal dot cx>
- To: ShÃrab <Sebastien dot Hinderer at ens-lyon dot org>
- Cc: libc-alpha at sourceware dot org,Samuel Thibault <Samuel dot Thibault at ens-lyon dot org>
- Date: Wed, 6 Feb 2013 09:54:09 -0500
- Subject: Re: Checking that a memory area is empty
- References: <20130206081119.GA6650@pema>
On Wed, Feb 06, 2013 at 09:11:19AM +0100, ShÃrab wrote:
> Dear all,
>
> It seems there is no function in the glibc at the moment to check
> whether a memory area is empty (contains onlyzeros).
>
> If this is correct, would it be possible to add such a function?
Slightly off-topic, but if your program needs such a function, it
could easily be implemented in terms of a loop performing memcmp on a
fixed-max-size subrange against a static const zero buffer of the
particular size.
Rich