From a92dd46dd529a0a48c37db08c3101e9677d0638d Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 27 Jan 2012 07:31:50 +0000 Subject: [PATCH] * gc.c (HEAP_ALIGN, HEAP_ALIGN_MASK): DRY, let compiler calculate from HEAP_ALIGN_LOG. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ gc.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ea76d9fe2..b35833af0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Jan 27 16:31:45 2012 Nobuyoshi Nakada + + * gc.c (HEAP_ALIGN, HEAP_ALIGN_MASK): DRY, let compiler calculate + from HEAP_ALIGN_LOG. + Thu Jan 26 11:03:37 2012 Eric Hodel * lib/matrix.rb: Clean up extra whitespace in output documentation. diff --git a/gc.c b/gc.c index 4c906e7ab2..f52b5fc348 100644 --- a/gc.c +++ b/gc.c @@ -538,8 +538,8 @@ rb_objspace_free(rb_objspace_t *objspace) /* tiny heap size: 16KB */ #define HEAP_ALIGN_LOG 14 -#define HEAP_ALIGN 0x4000 -#define HEAP_ALIGN_MASK 0x3fff +#define HEAP_ALIGN (1UL << HEAP_ALIGN_LOG) +#define HEAP_ALIGN_MASK (~(~0UL << HEAP_ALIGN_LOG)) #define REQUIRED_SIZE_BY_MALLOC (sizeof(size_t) * 5) #define HEAP_SIZE (HEAP_ALIGN - REQUIRED_SIZE_BY_MALLOC)