diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-11 05:44:36 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-05-11 05:44:36 +0000 |
commit | e389ce0676d8538dee44e47949bfdef1b81da85f (patch) | |
tree | fb282c585d83304804ff0625b2011191febfb95c /include/ruby | |
parent | 14a97fd48aad077f7e239a20dd30cad41c0f6d8f (diff) | |
download | ruby-e389ce0676d8538dee44e47949bfdef1b81da85f.tar.gz |
* include/ruby/ruby.h (SIZET2NUM): new macro.
(NUM2SIZET): new macro.
* gc.c (struct rb_objspace): use size_t for increment, length and
used for 64bit.
(allocate_heaps): ditto.
(assign_heap_slot): ditto.
(set_heaps_increment): ditto.
(gc_mark_all): ditto.
(is_pointer_to_heap): ditto.
(free_unused_heaps): ditto.
(gc_sweep): ditto.
(os_obj_of): ditto.
(rb_gc_call_finalizer_at_exit): ditto.
(count_objects): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby')
-rw-r--r-- | include/ruby/ruby.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index da4c48f447..c3696ff866 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -171,6 +171,14 @@ VALUE rb_ull2inum(unsigned LONG_LONG); # define OFFT2NUM(v) INT2NUM(v) #endif +#if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG) +# define SIZET2NUM(v) ULL2NUM(v) +#elif SIZEOF_SIZE_T == SIZEOF_LONG +# define SIZET2NUM(v) ULONG2NUM(v) +#else +# define SIZET2NUM(v) UINT2NUM(v) +#endif + #ifndef PIDT2NUM #define PIDT2NUM(v) LONG2NUM(v) #endif @@ -364,6 +372,12 @@ unsigned LONG_LONG rb_num2ull(VALUE); # define NUM2OFFT(x) NUM2LONG(x) #endif +#if defined(HAVE_LONG_LONG) && SIZEOF_SIZE_T > SIZEOF_LONG +# define NUM2SIZET(x) ((size_t)NUM2ULL(x)) +#else +# define NUM2SIZET(x) NUM2ULONG(x) +#endif + double rb_num2dbl(VALUE); #define NUM2DBL(x) rb_num2dbl((VALUE)(x)) |