Re: SlabCheck leaks memory into TopMemoryContext - Mailing list pgsql-hackers

From Tom Lane
Subject Re: SlabCheck leaks memory into TopMemoryContext
Date
Msg-id 563.1579193014@sss.pgh.pa.us
Whole thread Raw
In response to Re: SlabCheck leaks memory into TopMemoryContext  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: SlabCheck leaks memory into TopMemoryContext
List pgsql-hackers
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> The attached fix should do the trick - it pre-allocates the space when
> creating the context. There is a bit of complexity because we want to
> allocate the space as part of the context header, but nothin too bad. We
> might optimize it a bit by using a regular bitmap (instead of just an
> array of bools), but I haven't done that.

Hmm ... so if this is an array of bools, why isn't it declared bool*
rather than char* ?  (Pre-existing ugliness, sure, but we might as
well fix it while we're here.  Especially since you used sizeof(bool)
in the space calculation.)

I agree that maxaligning the start point of the array is pointless.

I'd write "free chunks in a block" not "free chunks on a block",
the latter seems rather shaky English.  But that's getting picky.

LGTM otherwise.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Code cleanup for build_regexp_split_result
Next
From: Andres Freund
Date:
Subject: Re: SlabCheck leaks memory into TopMemoryContext