diff options
author | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-14 09:11:24 +0000 |
---|---|---|
committer | nari <nari@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-02-14 09:11:24 +0000 |
commit | 64e7aedceef872e8f942cb8eb672d0bc32c13984 (patch) | |
tree | e600d7a9d2edb6f550e3507a8c69f2c2613d3c57 /gc.c | |
parent | 52cb46337e9e5bd78f0a64a114ec8004173b2525 (diff) | |
download | ruby-64e7aedceef872e8f942cb8eb672d0bc32c13984.tar.gz |
* 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
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -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; |