pgstat cleanup: use palloc and AllocateFile

From: Neil Conway <neilc(at)samurai(dot)com>
To: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: pgstat cleanup: use palloc and AllocateFile
Date: 2004-10-27 01:20:50
Message-ID: 1098840050.1964.6.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

This patch changes pgstat.c to use palloc(), AllocateFile() and
FreeFile() rather than malloc(), fopen() and fclose(), respectively.

I changed more_tabstat_space() (which is invoked at various times
indirectly throughout the backend) to allocate memory in its own private
memory context, rather than use malloc() -- we can't just use
CurrentMemoryContext because that may not be sufficiently long-lived.

Barring any objections I intend to apply this to HEAD tomorrow.

-Neil

Attachment Content-Type Size
pgstat_malloc_cleanup-3.patch text/x-patch 8.5 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Curt Sampson 2004-10-27 01:32:13 Re: [PATCHES] ARC Memory Usage analysis
Previous Message Bruce Momjian 2004-10-27 00:43:13 Re: pg_ctl -D canonicalization