From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.8 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 645041F404; Fri, 10 Aug 2018 06:57:28 +0000 (UTC) Date: Fri, 10 Aug 2018 06:57:28 +0000 From: Eric Wong To: mwrap-public@80x24.org Subject: [SQUASH] 32-bit fixes Message-ID: <20180810065728.GA17003@dcvr> References: <20180810064943.24287-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180810064943.24287-1-e@80x24.org> List-Id: --- ext/mwrap/mwrap.c | 4 +--- test/test_mwrap.rb | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ext/mwrap/mwrap.c b/ext/mwrap/mwrap.c index b2d169f..29cfc11 100644 --- a/ext/mwrap/mwrap.c +++ b/ext/mwrap/mwrap.c @@ -1208,9 +1208,7 @@ static VALUE hpb_each_yield(VALUE ignore) VALUE v[2]; /* [ generation, address ] */ void *addr = hdr2ptr(h); assert(ptr_is_aligned(addr, HEAP_PAGE_ALIGN)); - v[0] = sizeof(void *) == sizeof(long) ? - LONG2NUM((long)addr) : - LL2NUM((LONG_LONG)addr); + v[0] = LONG2NUM((long)addr); v[1] = SIZET2NUM(h->as.live.gen); rb_yield_values2(2, v); } diff --git a/test/test_mwrap.rb b/test/test_mwrap.rb index 6c66460..9c6141d 100644 --- a/test/test_mwrap.rb +++ b/test/test_mwrap.rb @@ -298,14 +298,14 @@ class TestMwrap < Test::Unit::TestCase (0 == (addr & 16383)) or abort "addr not aligned: #{'%x' % addr}" end nr == ap or abort 'HeapPageBody.each missed page' - 5.times { (1..20000).to_a.map(&:to_s) } + 10.times { (1..20000).to_a.map(&:to_s) } 3.times { GC.start } Mwrap::HeapPageBody.stat(h) Integer === h[:lifespan_max] or abort 'lifespan_max not recorded' Integer === h[:lifespan_min] or abort 'lifespan_min not recorded' Float === h[:lifespan_mean] or abort 'lifespan_mean not recorded' 3.times { GC.start } - 5.times { (1..20000).to_a.map(&:to_s) } + 10.times { (1..20000).to_a.map(&:to_s) } Mwrap::HeapPageBody.stat(h) h[:deathspan_min] <= h[:deathspan_max] or abort 'wrong min/max deathtime' -- EW