diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-26 05:24:19 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-05-26 05:24:19 +0000 |
commit | 3898e7b8eec31631a928fa48f7a5f278301a4100 (patch) | |
tree | 3b92c999af566d85680cc6beabb5aa0f91409bdd | |
parent | 8e86bd59c02bd17e838c89e2dd33e095cc270777 (diff) | |
download | ruby-3898e7b8eec31631a928fa48f7a5f278301a4100.tar.gz |
* gc.c: fixed types.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | gc.c | 12 |
2 files changed, 9 insertions, 7 deletions
@@ -1,4 +1,6 @@ -Tue May 26 13:58:13 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> +Tue May 26 14:24:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * gc.c: fixed types. * common.mk (bignum.o, numeric.o): depend on util.h. @@ -289,7 +289,7 @@ enum lifetime { struct heaps_slot { void *membase; RVALUE *slot; - int limit; + size_t limit; enum lifetime lifetime; }; @@ -619,7 +619,7 @@ garbage_collect_with_gvl(rb_objspace_t *objspace) } else { if (ruby_native_thread_p()) { - return (VALUE)rb_thread_call_with_gvl(gc_with_gvl, (void *)objspace); + return (int)(VALUE)rb_thread_call_with_gvl(gc_with_gvl, (void *)objspace); } else { /* no ruby thread */ @@ -888,7 +888,7 @@ assign_heap_slot(rb_objspace_t *objspace, RVALUE **list, enum lifetime lifetime) { RVALUE *p, *pend, *membase; size_t hi, lo, mid; - int objs; + size_t objs; objs = HEAP_OBJ_LIMIT; p = (RVALUE*)malloc(HEAP_SIZE); @@ -901,7 +901,7 @@ assign_heap_slot(rb_objspace_t *objspace, RVALUE **list, enum lifetime lifetime) membase = p; if ((VALUE)p % sizeof(RVALUE) != 0) { p = (RVALUE*)((VALUE)p + sizeof(RVALUE) - ((VALUE)p % sizeof(RVALUE))); - if ((HEAP_SIZE - HEAP_OBJ_LIMIT * sizeof(RVALUE)) < ((char*)p - (char*)membase)) { + if ((HEAP_SIZE - HEAP_OBJ_LIMIT * sizeof(RVALUE)) < (size_t)((char*)p - (char*)membase)) { objs--; } } @@ -1848,7 +1848,7 @@ gc_sweep(rb_objspace_t *objspace) final_list = deferred_final_list; deferred_final_list = 0; for (i = 0; i < heaps_used; i++) { - int free_num = 0, final_num = 0; + size_t free_num = 0, final_num = 0; RVALUE *free = freelist; RVALUE *final = final_list; int deferred; @@ -2186,7 +2186,7 @@ rb_gc_mark_remembered_set(rb_objspace_t *objspace) static void clear_mark_longlife_heaps(rb_objspace_t *objspace) { - int i; + size_t i; for (i = 0; i < heaps_used; i++) { RVALUE *p, *pend; |