Re: Proposal for fixing intra-query memory leaks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proposal for fixing intra-query memory leaks
Date: 2000-05-02 22:01:03
Message-ID: 5180.957304863@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Karel Zak <zakkr(at)zf(dot)jcu(dot)cz> writes:
> IMHO in standard chunk header not must be chunk size. If something needs
> chunk size it cat use depend-header.

We might as well put the size in the standard header, though, because
(a) all context management methods are going to need it (how you gonna
do repalloc otherwise?) and (b) there are alignment considerations.
The size of the headers has to be a multiple of MAXALIGN which is 8
on quite a few architectures. If you just make each of the
standard-header and depend-header a multiple of MAXALIGN then you end
up wasting 8 bytes per alloc chunk on these machines. You could get
around that with some notational ugliness (ie, standard header is not
declared as part of depend-header but you compute the pointer to it
separately). But I don't see the value of working that hard to keep
the size out of the standard header.

Also, since aset.c is going to be our standard memory allocator for
the foreseeable future, there's no good reason to make its life more
difficult by having to work with both a standard-header and a
depend-header. If it can get along with only a standard-header,
why not let it do so?

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mitch Vincent 2000-05-02 22:28:31 Re: Why Not MySQL?
Previous Message Bruce Momjian 2000-05-02 21:55:06 Re: Why Not MySQL?