Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c85a535

Browse files
committed
Fix bug in shmem initialization
1 parent 2d69b46 commit c85a535

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/raftable/state.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void state_shmem_request()
252252
info.entrysize = sizeof(RaftableEntry);
253253
info.dsize = info.max_dsize = hash_select_dirsize(RAFTABLE_HASH_SIZE);
254254
flags = HASH_SHARED_MEM | HASH_ALLOC | HASH_DIRSIZE | HASH_ELEM;
255-
RequestAddinShmemSpace(RAFTABLE_BLOCK_MEM + sizeof(State) + hash_get_shared_size(&info, flags));
255+
RequestAddinShmemSpace(RAFTABLE_BLOCK_MEM + BUFFERALIGN(sizeof(State)) + BUFFERALIGN(hash_get_shared_size(&info, flags)));
256256
RequestNamedLWLockTranche("raftable", 1);
257257
}
258258

@@ -267,7 +267,7 @@ StateP state_shmem_init()
267267

268268
state = ShmemInitStruct(
269269
"raftable_state",
270-
RAFTABLE_BLOCK_MEM,
270+
sizeof(State),
271271
&found
272272
);
273273
Assert(state);

0 commit comments

Comments
 (0)