Skip to content

Commit 5945932

Browse files
committed
gc: fix 64-bit issue
1 parent 52cb463 commit 5945932

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

gc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,9 +1165,7 @@ assign_heap_slot(rb_objspace_t *objspace)
11651165
p = (RVALUE*)((VALUE)p + sizeof(struct heaps_header));
11661166
if ((VALUE)p % sizeof(RVALUE) != 0) {
11671167
p = (RVALUE*)((VALUE)p + sizeof(RVALUE) - ((VALUE)p % sizeof(RVALUE)));
1168-
if ((HEAP_SIZE - HEAP_OBJ_LIMIT * sizeof(RVALUE)) < (size_t)((char*)p - (char*)membase)) {
1169-
objs--;
1170-
}
1168+
objs = (HEAP_SIZE - (size_t)((char*)p - (char*)membase))/sizeof(RVALUE);
11711169
}
11721170

11731171
lo = 0;

0 commit comments

Comments
 (0)