On Sun, Nov 03, 2013 at 12:04:36PM -0800, Paul Eggert wrote:
> Ondřej Bílka wrote:
> > +XALLOC_INLINE void *
> > +nmalloc (size_t n, size_t s)
> > +{
> > +  if (xalloc_oversized (n, s))
> > +    xalloc_die ();
> > +  return xmalloc (n * s);
> > +}
> 
> This is the same as the existing xnmalloc, so why bother with a new name?
> Similarly for the other changes.

I accidentally inlined wrong version. As idea is to handle overflow by
oom logic these should be:

nmalloc (size_t n, size_t s)
{
  if (xalloc_oversized (n, s))
    NULL;
  return malloc (n * s);
}


Reply via email to