On Wed, Oct 22, 2014 at 10:58:32AM +0200, Thomas Schwinge wrote:
> So, something in spirit of what has been implemented in
> gcc/config/i386/gmm_malloc.h.

Yeah, though don't take that literally, gmm_malloc.h e.g. isn't very secure,
_mm_malloc (-16384, 32768);
might very well result in heap corruption already by the inline function, or
by the caller, even when the malloc inside
of it actually allocated just 16384 bytes.

There should be:
  if (size >= -align)
    {
      errno = ENOMEM;
      return (void *) 0;
    }
before the malloc call.

        Jakub

Reply via email to