ruby-changes:22472
From: nobu <ko1@a...>
Date: Fri, 10 Feb 2012 01:29:18 +0900 (JST)
Subject: [ruby-changes:22472] nobu:r34521 (trunk): * ext/dl/dl.h (DLALIGN): round up at once and get rid of overflow.
nobu 2012-02-10 01:29:08 +0900 (Fri, 10 Feb 2012) New Revision: 34521 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34521 Log: * ext/dl/dl.h (DLALIGN): round up at once and get rid of overflow. Modified files: trunk/ChangeLog trunk/ext/dl/dl.h Index: ChangeLog =================================================================== --- ChangeLog (revision 34520) +++ ChangeLog (revision 34521) @@ -1,3 +1,7 @@ +Fri Feb 10 01:29:05 2012 Nobuyoshi Nakada <nobu@r...> + + * ext/dl/dl.h (DLALIGN): round up at once and get rid of overflow. + Fri Feb 10 00:47:07 2012 Nobuyoshi Nakada <nobu@r...> * test/ruby/envutil.rb (assert_no_memory_leak): new assertion to Index: ext/dl/dl.h =================================================================== --- ext/dl/dl.h (revision 34520) +++ ext/dl/dl.h (revision 34521) @@ -155,9 +155,8 @@ #define ALIGN_FLOAT (sizeof(s_float) - sizeof(float)) #define ALIGN_DOUBLE (sizeof(s_double) - sizeof(double)) -#define DLALIGN(ptr,offset,align) {\ - while( (((unsigned long)((char *)(ptr) + (offset))) % (align)) != 0 ) (offset)++;\ -} +#define DLALIGN(ptr,offset,align) \ + ((offset) += ((align) - ((uintptr_t)((char *)(ptr) + (offset))) % (align)) % (align)) #define DLTYPE_VOID 0 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/