зеркало из https://github.com/github/ruby.git
* gc.c (gc_mark): enable GC stack checking.
* string.c (str_gsub): lock strings temporarily. [ruby-dev:24687] * ext/socket/socket.c (s_recvfrom): tmplock input buffer. [ruby-dev:24705] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
77d3f40c90
Коммит
27715649f4
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
Thu Nov 4 09:11:35 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* gc.c (gc_mark): enable GC stack checking.
|
||||
|
||||
Thu Nov 4 03:11:33 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* string.c (str_gsub): lock strings temporarily. [ruby-dev:24687]
|
||||
|
||||
* ext/socket/socket.c (s_recvfrom): tmplock input buffer.
|
||||
[ruby-dev:24705]
|
||||
|
||||
Wed Nov 3 22:24:17 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||
|
||||
* lib/webrick/httpauth/digestauth.rb: use Base64.encode64 to
|
||||
|
|
|
@ -474,10 +474,12 @@ s_recvfrom(sock, argc, argv, from)
|
|||
str = rb_tainted_str_new(0, buflen);
|
||||
|
||||
retry:
|
||||
rb_str_locktmp(str);
|
||||
rb_thread_wait_fd(fd);
|
||||
TRAP_BEG;
|
||||
slen = recvfrom(fd, RSTRING(str)->ptr, buflen, flags, (struct sockaddr*)buf, &alen);
|
||||
TRAP_END;
|
||||
rb_str_unlocktmp(str);
|
||||
|
||||
if (slen < 0) {
|
||||
if (rb_io_wait_readable(fd)) {
|
||||
|
|
6
gc.c
6
gc.c
|
@ -648,7 +648,7 @@ mark_tbl(tbl, lev)
|
|||
int lev;
|
||||
{
|
||||
if (!tbl) return;
|
||||
st_foreach(tbl, mark_entry, lev+1);
|
||||
st_foreach(tbl, mark_entry, lev);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -675,7 +675,7 @@ mark_hash(tbl, lev)
|
|||
int lev;
|
||||
{
|
||||
if (!tbl) return;
|
||||
st_foreach(tbl, mark_keyvalue, lev+1);
|
||||
st_foreach(tbl, mark_keyvalue, lev);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -721,7 +721,7 @@ gc_mark(ptr, lev)
|
|||
}
|
||||
return;
|
||||
}
|
||||
gc_mark_children(ptr, lev);
|
||||
gc_mark_children(ptr, lev+1);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
5
string.c
5
string.c
|
@ -464,6 +464,7 @@ str_independent(str)
|
|||
VALUE str;
|
||||
{
|
||||
if (FL_TEST(str, STR_TMPLOCK)) {
|
||||
FL_UNSET(str, STR_TMPLOCK);
|
||||
rb_raise(rb_eRuntimeError, "can't modify string; temporarily locked");
|
||||
}
|
||||
if (OBJ_FROZEN(str)) rb_error_frozen("string");
|
||||
|
@ -2075,6 +2076,8 @@ str_gsub(argc, argv, str, bang)
|
|||
bp = buf;
|
||||
cp = RSTRING(str)->ptr;
|
||||
|
||||
rb_str_locktmp(str);
|
||||
rb_str_locktmp(dest);
|
||||
while (beg >= 0) {
|
||||
n++;
|
||||
match = rb_backref_get();
|
||||
|
@ -2132,6 +2135,8 @@ str_gsub(argc, argv, str, bang)
|
|||
}
|
||||
rb_backref_set(match);
|
||||
*bp = '\0';
|
||||
rb_str_unlocktmp(str);
|
||||
rb_str_unlocktmp(dest);
|
||||
if (bang) {
|
||||
if (str_independent(str)) {
|
||||
free(RSTRING(str)->ptr);
|
||||
|
|
Загрузка…
Ссылка в новой задаче