Skip to content

Commit 1aff1dc

Browse files
committed
Revert "Improve accounting for memory used by shared hash tables"
This reverts commit f5930f9. This broke the expansion of private hash tables, which reallocates the directory. But that's impossible when it's allocated together with the other fields, and dir_realloc() failed with BogusFree. Clearly, this needs rethinking. Discussion: https://postgr.es/m/CAApHDvriCiNkm=v521AP6PKPfyWkJ++jqZ9eqX4cXnhxLv8w-A@mail.gmail.com
1 parent 88f55bc commit 1aff1dc

File tree

3 files changed

+66
-222
lines changed

3 files changed

+66
-222
lines changed

src/backend/storage/ipc/shmem.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
#include "storage/shmem.h"
7474
#include "storage/spin.h"
7575
#include "utils/builtins.h"
76-
#include "utils/dynahash.h"
7776

7877
static void *ShmemAllocRaw(Size size, Size *allocated_size);
7978

@@ -347,8 +346,7 @@ ShmemInitHash(const char *name, /* table string name for shmem index */
347346

348347
/* look it up in the shmem index */
349348
location = ShmemInitStruct(name,
350-
hash_get_size(infoP, hash_flags,
351-
init_size, true),
349+
hash_get_shared_size(infoP, hash_flags),
352350
&found);
353351

354352
/*

0 commit comments

Comments
 (0)