Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit94884e1

Browse files
committed
Make slab allocator work on platforms with MAXIMUM_ALIGNOF < sizeof(int).
Notably, m68k only needs 2-byte alignment. Per report from Christoph Berg.Discussion:https://www.postgresql.org/message-id/20170517193957.fwntkgi6epuso5l2@msg.df7cb.de
1 parent3ec76ff commit94884e1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/utils/mmgr/slab.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ SlabContextCreate(MemoryContext parent,
194194
MAXALIGN(sizeof(SlabChunk)),
195195
"padding calculation in SlabChunk is wrong");
196196

197-
/*otherwisethe linked listinside freed chunk isn't guaranteed to fit */
198-
StaticAssertStmt(MAXIMUM_ALIGNOF >=sizeof(int),
199-
"MAXALIGN too small to fit int32");
197+
/*Make surethe linked listnode fits inside a freed chunk */
198+
if (chunkSize<sizeof(int))
199+
chunkSize=sizeof(int);
200200

201201
/* chunk, including SLAB header (both addresses nicely aligned) */
202202
fullChunkSize=MAXALIGN(sizeof(SlabChunk)+MAXALIGN(chunkSize));

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp