mirror of
https://github.com/postgres/postgres.git
synced 2025-11-24 00:23:06 +03:00
Remove useless (and broken) logging logic in memory context functions.
Nobody really uses this stuff, especially not since we created valgrind-based infrastructure that does the same thing better. It is thus unsurprising that the generation.c and slab.c versions were actually broken. Rather than fix 'em, let's just remove 'em. Alexander Lakhin Discussion: https://postgr.es/m/8936216c-3492-3f6e-634b-d638fddc5f91@gmail.com
This commit is contained in:
@@ -157,22 +157,6 @@ static const MemoryContextMethods SlabMethods = {
|
||||
#endif
|
||||
};
|
||||
|
||||
/* ----------
|
||||
* Debug macros
|
||||
* ----------
|
||||
*/
|
||||
#ifdef HAVE_ALLOCINFO
|
||||
#define SlabFreeInfo(_cxt, _chunk) \
|
||||
fprintf(stderr, "SlabFree: %s: %p, %zu\n", \
|
||||
(_cxt)->header.name, (_chunk), (_chunk)->header.size)
|
||||
#define SlabAllocInfo(_cxt, _chunk) \
|
||||
fprintf(stderr, "SlabAlloc: %s: %p, %zu\n", \
|
||||
(_cxt)->header.name, (_chunk), (_chunk)->header.size)
|
||||
#else
|
||||
#define SlabFreeInfo(_cxt, _chunk)
|
||||
#define SlabAllocInfo(_cxt, _chunk)
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* SlabContextCreate
|
||||
@@ -499,8 +483,6 @@ SlabAlloc(MemoryContext context, Size size)
|
||||
randomize_mem((char *) SlabChunkGetPointer(chunk), size);
|
||||
#endif
|
||||
|
||||
SlabAllocInfo(slab, chunk);
|
||||
|
||||
Assert(slab->nblocks * slab->blockSize == context->mem_allocated);
|
||||
|
||||
return SlabChunkGetPointer(chunk);
|
||||
@@ -518,8 +500,6 @@ SlabFree(MemoryContext context, void *pointer)
|
||||
SlabChunk *chunk = SlabPointerGetChunk(pointer);
|
||||
SlabBlock *block = chunk->block;
|
||||
|
||||
SlabFreeInfo(slab, chunk);
|
||||
|
||||
#ifdef MEMORY_CONTEXT_CHECKING
|
||||
/* Test for someone scribbling on unused space in chunk */
|
||||
if (slab->chunkSize < (slab->fullChunkSize - sizeof(SlabChunk)))
|
||||
|
||||
Reference in New Issue
Block a user