postgresql/src/backend
Bruce Momjian 46fb9c29e2 Here is the patch with memory leak checker. This checker allow detect
in-chunk leaks, overwrite-next-chunk leaks and overwrite block-freeptr leaks.

A in-chunk leak --- if something overwrite space after wanted (via palloc()
size, but it is still inside chunk. For example

        x = palloc(12);         /* create 16b chunk */
        memset(x, '#', 13);

this leak is in the current source total invisible, because chunk is 16b and
leak is in the "align space".

 For this feature I add data_size to StandardChunk, and all memory which go
from AllocSetAlloc() is marked as 0x7F.

 The MemoryContextCheck() is compiled '#ifdef USE_ASSERT_CHECKING'.

I add this checking to 'tcop/postgres.c' and is active after each backend
query, but it is probably not sufficient, because some MemoryContext exist
only during memory processing --- will good if someone who known where
it is needful (Tom:-) add it for others contexts;
 A problem in the current source is that we have still some malloc()
allocation that is not needful and this allocation is total invisible for
all context routines. For example Dllist in backend (pretty dirty it is in
catcache where values in Dllist are palloc-ed, but list is malloc-ed).
--- and BTW. this Dllist design stand in the way for query cache :-)

 Tom, if you agree I start replace some mallocs.

 BTW. --- Tom, have you idea for across transaction presistent allocation for
          SQL functions? (like regex - now it is via malloc)


 I almost forget. I add one if() to AllocSetAlloc(), for 'size' that are
greater than ALLOC_BIGCHUNK_LIMIT is not needful check AllocSetFreeIndex(),
because 'fidx' is always 'ALLOCSET_NUM_FREELISTS - 1'. It a little brisk up
allocation for very large chunks. Right?

                                                Karel
2000-07-11 14:30:37 +00:00
..
access Some security checks that we've found an external value completely 2000-07-11 12:32:03 +00:00
bootstrap Make toast-table creation and deletion work somewhat reliably. 2000-07-04 06:11:54 +00:00
catalog Fix sed invocation, from Keith Parks 2000-07-09 13:16:12 +00:00
commands Remove long-dead support for invoking queries from dynamically loaded 2000-07-08 03:04:41 +00:00
executor Fix bogus DatumGetInt32 coercion. 2000-07-09 04:17:53 +00:00
lib First phase of memory management rewrite (see backend/utils/mmgr/README 2000-06-28 03:33:33 +00:00
libpq typo 2000-07-09 13:48:45 +00:00
main Generated header files parse.h and fmgroids.h are now copied into 2000-05-29 05:45:56 +00:00
nodes Add test code to copy all parse/plan trees. Repair essential omissions 2000-06-29 07:35:57 +00:00
optimizer Update textin() and textout() to new fmgr style. This is just phase 2000-07-05 23:12:09 +00:00
parser oidvectortypes: use SQL type names and separate by commas 2000-07-09 21:30:21 +00:00
port Fix misuse of StrNCpy to copy and add null to non-null-terminated data. 2000-07-07 21:12:53 +00:00
postmaster Another round of those unportable config/build changes :-/ 2000-07-09 13:14:19 +00:00
regex Generated header files parse.h and fmgroids.h are now copied into 2000-05-29 05:45:56 +00:00
rewrite Make view/rule permission checking behave properly with 2000-07-09 04:56:32 +00:00
storage Prevent creating a boatload of empty segments when md.c is asked to 2000-07-10 04:32:00 +00:00
tcop Here is the patch with memory leak checker. This checker allow detect 2000-07-11 14:30:37 +00:00
tioga Generated header files parse.h and fmgroids.h are now copied into 2000-05-29 05:45:56 +00:00
utils Here is the patch with memory leak checker. This checker allow detect 2000-07-11 14:30:37 +00:00
Makefile Put back separate install-bin target ... I was using that, 2000-07-08 02:40:27 +00:00