1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* gc.c: fixed types.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-05-26 05:24:19 +00:00
parent 8e86bd59c0
commit 3898e7b8ee
2 changed files with 9 additions and 7 deletions

View file

@ -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. * common.mk (bignum.o, numeric.o): depend on util.h.

12
gc.c
View file

@ -289,7 +289,7 @@ enum lifetime {
struct heaps_slot { struct heaps_slot {
void *membase; void *membase;
RVALUE *slot; RVALUE *slot;
int limit; size_t limit;
enum lifetime lifetime; enum lifetime lifetime;
}; };
@ -619,7 +619,7 @@ garbage_collect_with_gvl(rb_objspace_t *objspace)
} }
else { else {
if (ruby_native_thread_p()) { 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 { else {
/* no ruby thread */ /* no ruby thread */
@ -888,7 +888,7 @@ assign_heap_slot(rb_objspace_t *objspace, RVALUE **list, enum lifetime lifetime)
{ {
RVALUE *p, *pend, *membase; RVALUE *p, *pend, *membase;
size_t hi, lo, mid; size_t hi, lo, mid;
int objs; size_t objs;
objs = HEAP_OBJ_LIMIT; objs = HEAP_OBJ_LIMIT;
p = (RVALUE*)malloc(HEAP_SIZE); p = (RVALUE*)malloc(HEAP_SIZE);
@ -901,7 +901,7 @@ assign_heap_slot(rb_objspace_t *objspace, RVALUE **list, enum lifetime lifetime)
membase = p; membase = p;
if ((VALUE)p % sizeof(RVALUE) != 0) { if ((VALUE)p % sizeof(RVALUE) != 0) {
p = (RVALUE*)((VALUE)p + sizeof(RVALUE) - ((VALUE)p % sizeof(RVALUE))); 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--; objs--;
} }
} }
@ -1848,7 +1848,7 @@ gc_sweep(rb_objspace_t *objspace)
final_list = deferred_final_list; final_list = deferred_final_list;
deferred_final_list = 0; deferred_final_list = 0;
for (i = 0; i < heaps_used; i++) { 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 *free = freelist;
RVALUE *final = final_list; RVALUE *final = final_list;
int deferred; int deferred;
@ -2186,7 +2186,7 @@ rb_gc_mark_remembered_set(rb_objspace_t *objspace)
static void static void
clear_mark_longlife_heaps(rb_objspace_t *objspace) clear_mark_longlife_heaps(rb_objspace_t *objspace)
{ {
int i; size_t i;
for (i = 0; i < heaps_used; i++) { for (i = 0; i < heaps_used; i++) {
RVALUE *p, *pend; RVALUE *p, *pend;