2013/1/14 Mike Hommey <m...@glandium.org>

> On Mon, Jan 14, 2013 at 11:43:44AM +1300, Robert O'Callahan wrote:
> > I need a big read-only buffer full of zeroes. On Linux I could mmap
> > /dev/zero read-only, and something similar on Windows/Mac I'm sure, but
> do
> > we already have code for that, or better yet something like that already
> > mapped into memory?
>
> You could just use calloc(). Jemalloc will do the appropriate thing.
>

Out of curiosity, how can it? Since the block returned by calloc is not
read-only, how would a subsequent non-zero write be handled?
Benoit


>
> Mike
> _______________________________________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to