On Fri, Apr 09, 2021 at 07:39:05AM +0200, Theo Buehler wrote:

> On Fri, Apr 09, 2021 at 07:36:35AM +0200, Otto Moerbeek wrote:
> > On Thu, Apr 01, 2021 at 11:23:58AM +0200, Otto Moerbeek wrote:
> > 
> > > Hi,
> > > 
> > > here's a small malloc diff. Most important part is an extra internal
> > > consistency check. I have been running this for a few week already,
> > 
> > ping?
> 
> Been running this since you posted it on several busy boxes.
> 
> ok tb

Thanks, will commit soon.

        -Otto

> 
> > 
> > > 
> > >   -Otto
> > > 
> > > Index: stdlib/malloc.3
> > > ===================================================================
> > > RCS file: /cvs/src/lib/libc/stdlib/malloc.3,v
> > > retrieving revision 1.127
> > > diff -u -p -r1.127 malloc.3
> > > --- stdlib/malloc.3       25 Feb 2021 15:20:18 -0000      1.127
> > > +++ stdlib/malloc.3       1 Apr 2021 09:21:59 -0000
> > > @@ -366,7 +366,8 @@ If a program changes behavior if any of 
> > >  are used,
> > >  it is buggy.
> > >  .Pp
> > > -The default number of free pages cached is 64 per malloc pool.
> > > +The default size of the cache is 64 single page allocations.
> > > +It also caches a number of larger regions.
> > >  Multi-threaded programs use multiple pools.
> > >  .Sh RETURN VALUES
> > >  Upon successful completion, the allocation functions
> > > Index: stdlib/malloc.c
> > > ===================================================================
> > > RCS file: /cvs/src/lib/libc/stdlib/malloc.c,v
> > > retrieving revision 1.269
> > > diff -u -p -r1.269 malloc.c
> > > --- stdlib/malloc.c       9 Mar 2021 07:39:28 -0000       1.269
> > > +++ stdlib/malloc.c       1 Apr 2021 09:22:00 -0000
> > > @@ -1404,6 +1404,8 @@ ofree(struct dir_info **argpool, void *p
> > >   } else {
> > >           /* Validate and optionally canary check */
> > >           struct chunk_info *info = (struct chunk_info *)r->size;
> > > +         if (info->size != sz)
> > > +                 wrterror(pool, "internal struct corrupt");
> > >           find_chunknum(pool, info, p, mopts.chunk_canaries);
> > >           if (!clear) {
> > >                   void *tmp;
> > > @@ -1608,6 +1610,7 @@ orealloc(struct dir_info **argpool, void
> > >                   }
> > >                   if (munmap((char *)r->p + rnewsz, roldsz - rnewsz))
> > >                           wrterror(pool, "munmap %p", (char *)r->p + 
> > > rnewsz);
> > > +                 STATS_SUB(d->malloc_used, roldsz - rnewsz);
> > >                   r->size = gnewsz;
> > >                   if (MALLOC_MOVE_COND(gnewsz)) {
> > >                           void *pp = MALLOC_MOVE(r->p, gnewsz);
> > > 
> > > 
> > 
> 

Reply via email to