diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | gc.c | 4 |
2 files changed, 7 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Tue Feb 14 18:07:20 2012 Narihiro Nakamura <authornari@gmail.com> + + * gc.c (assign_heap_slot): SEGV happens cause on 64-bit platform + sometime there should be `objs-=2` instead of `objs--`. + patched by Sokolov Yura. https://github.com/ruby/ruby/pull/92 + Tue Feb 14 16:00:30 2012 Nobuyoshi Nakada <nobu@ruby-lang.org> * io.c (io_setstrbuf): cut down the buffer if longer. @@ -1165,9 +1165,7 @@ assign_heap_slot(rb_objspace_t *objspace) p = (RVALUE*)((VALUE)p + sizeof(struct heaps_header)); if ((VALUE)p % sizeof(RVALUE) != 0) { p = (RVALUE*)((VALUE)p + sizeof(RVALUE) - ((VALUE)p % sizeof(RVALUE))); - if ((HEAP_SIZE - HEAP_OBJ_LIMIT * sizeof(RVALUE)) < (size_t)((char*)p - (char*)membase)) { - objs--; - } + objs = (HEAP_SIZE - (size_t)((VALUE)p - (VALUE)membase))/sizeof(RVALUE); } lo = 0; |