mirror of
https://github.com/ruby/ruby.git
synced 2025-09-21 03:24:00 +02:00
* 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
This commit is contained in:
parent
14a97fd48a
commit
e389ce0676
3 changed files with 64 additions and 31 deletions
|
@ -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))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue