Skip to content

Commit 7165c34

Browse files
authored
Merge pull request protocolbuffers#8195 from HannahShiSFB/gRPC-Ruby-issue-on-Windows
[Ruby] Fix: (SIGSEGV) gRPC-Ruby issue on Windows. memory alloc infinite recursion/run out of memory
2 parents 10599e6 + 68f72f3 commit 7165c34

File tree

1 file changed

+1
-1
lines changed
  • ruby/ext/google/protobuf_c

1 file changed

+1
-1
lines changed

ruby/ext/google/protobuf_c/upb.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2357,7 +2357,7 @@ static void upb_arena_addblock(upb_arena *a, void *ptr, size_t size,
23572357
}
23582358

23592359
static mem_block *upb_arena_allocblock(upb_arena *a, size_t size) {
2360-
size_t block_size = UPB_MAX(size, a->next_block_size) + sizeof(mem_block);
2360+
size_t block_size = UPB_MAX(size, a->next_block_size) + _upb_arena_alignup(sizeof(mem_block));
23612361
mem_block *block = upb_malloc(a->block_alloc, block_size);
23622362

23632363
if (!block) {

0 commit comments

Comments
 (0)