On Mon, Dec 9, 2013 at 11:08 PM, Glenn Fowler <glenn.s.fow...@gmail.com> wrote:
> On Mon, Dec 9, 2013 at 4:53 PM, Roland Mainz <roland.ma...@nrubsig.org>
> wrote:
[snip]
>> 4. The patch removes one unneccesary |memset(p, 0, size)| which was
>> touching pages and therefore allocating them
>
> if that memset(0) is in vmopen() then im not sure its unnecessary
>
> run these tests to check your patch with different sizes and with/without
> the memset(0)
>
> bin/package use
> cd builtin
> nmake test

Seems to be no problem... and neither valgrind nor Rational Purify
complained. I think the issue is that a memory page obtained via
|mmap(MAP_ANON)| is zero'ed by the system on the first
read/write/execute access.

This behaviour is AFAIK defined by some standard (POSIX) because Linux
has this extra |mmap()| flag:
-- snip --
       MAP_UNINITIALIZED (since Linux 2.6.33)
              Don't  clear anonymous pages.  This flag is intended to
improve performance on embedded devices.  This flag is only honored if
the kernel was configured with the
              CONFIG_MMAP_ALLOW_UNINITIALIZED option.  Because of the
security implications, that option is normally enabled only on
embedded devices (i.e., devices where  one
              has complete control of the contents of user memory).
-- snip --

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.ma...@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
ast-developers@lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to