1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-09-27 03:43:15 +00:00
parent d917f9af97
commit 3df207c883
3 changed files with 24 additions and 9 deletions

6
eval.c
View file

@ -7149,7 +7149,11 @@ rb_thread_schedule()
}
FOREACH_THREAD_FROM(curr, th) {
if (th->status <= THREAD_RUNNABLE) {
if (th->status == THREAD_TO_KILL) {
next = th;
break;
}
if (th->status == THREAD_RUNNABLE) {
if (!next || next->priority < th->priority)
next = th;
}

25
gc.c
View file

@ -753,19 +753,27 @@ obj_free(obj)
break;
case T_STRING:
#define STR_NO_ORIG FL_USER2 /* copied from string.c */
if (!RANY(obj)->as.string.orig || FL_TEST(obj, STR_NO_ORIG))
if (!RANY(obj)->as.string.orig || FL_TEST(obj, STR_NO_ORIG)) {
free(RANY(obj)->as.string.ptr);
}
break;
case T_ARRAY:
if (RANY(obj)->as.array.ptr) free(RANY(obj)->as.array.ptr);
if (RANY(obj)->as.array.ptr) {
free(RANY(obj)->as.array.ptr);
}
break;
case T_HASH:
if (RANY(obj)->as.hash.tbl)
if (RANY(obj)->as.hash.tbl) {
st_free_table(RANY(obj)->as.hash.tbl);
}
break;
case T_REGEXP:
if (RANY(obj)->as.regexp.ptr) re_free_pattern(RANY(obj)->as.regexp.ptr);
if (RANY(obj)->as.regexp.str) free(RANY(obj)->as.regexp.str);
if (RANY(obj)->as.regexp.ptr) {
re_free_pattern(RANY(obj)->as.regexp.ptr);
}
if (RANY(obj)->as.regexp.str) {
free(RANY(obj)->as.regexp.str);
}
break;
case T_DATA:
if (DATA_PTR(obj)) {
@ -798,7 +806,9 @@ obj_free(obj)
break;
case T_BIGNUM:
if (RANY(obj)->as.bignum.digits) free(RANY(obj)->as.bignum.digits);
if (RANY(obj)->as.bignum.digits) {
free(RANY(obj)->as.bignum.digits);
}
break;
case T_NODE:
switch (nd_type(obj)) {
@ -827,8 +837,9 @@ obj_free(obj)
break;
case T_STRUCT:
if (RANY(obj)->as.rstruct.ptr)
if (RANY(obj)->as.rstruct.ptr) {
free(RANY(obj)->as.rstruct.ptr);
}
break;
default:

View file

@ -94,7 +94,7 @@ void xfree _((void*));
#else
# if defined(HAVE_ALLOCA_H)
# include <alloca.h>
# else
# elif !defined(alloca)
char *alloca();
# endif
#endif /* __GNUC__ */