Re: Memory management, palloc

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gavin Sherry <swm(at)linuxworld(dot)com(dot)au>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Memory management, palloc
Date: 2001-03-08 15:14:12
Message-ID: 25596.984064452@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gavin Sherry <swm(at)linuxworld(dot)com(dot)au> writes:
> I've been looking through the memory management system today.

> When a request is made for a memory memory chunk larger than
> ALLOC_CHUNK_LIMIT, AllocSetAlloc() uses malloc() to give the request its
> own block. The result is tested by AllocSetAlloc() to see if the memory
> was allocated.

> Irrespective of this, a chunk can be returned which has not had memory
> allocated to it. There is no testing of the return status of
> palloc() through out the code.

What's your point?

palloc() does not have the same specification as malloc. It guarantees
to return allocated memory, or elog trying.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Sherry 2001-03-08 15:19:14 Re: Memory management, palloc
Previous Message Tom Lane 2001-03-08 14:59:34 Depending on system install scripts (was Re: COBOL)