summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-29 11:16:54 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-29 11:16:54 +0000
commitc5e08b764eb342538884b383f0e6428b6faf214b (patch)
treebdd21aa73442d7492b5edf20ec2d9208727eaa95 /enumerator.c
parent0c6940b718a5a552c4c15e84a5f0eec81a26ad0f (diff)
downloadruby-c5e08b764eb342538884b383f0e6428b6faf214b.tar.gz
* add RUBY_TYPED_FREE_IMMEDIATELY to data types which only use
safe functions during garbage collection such as xfree(). On default, T_DATA objects are freed at same points as fianlizers. This approach protects issues such as reported by [ruby-dev:35578]. However, freeing T_DATA objects immediately helps heap usage. Most of T_DATA (in other words, most of dfree functions) are safe. However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default for safety. * cont.c: ditto. * dir.c: ditto. * encoding.c: ditto. * enumerator.c: ditto. * error.c: ditto. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * iseq.c: ditto. * marshal.c: ditto. * parse.y: ditto. * proc.c: ditto. * process.c: ditto. * random.c: ditto. * thread.c: ditto. * time.c: ditto. * transcode.c: ditto. * variable.c: ditto. * vm.c: ditto. * vm_backtrace.c: ditto. * vm_trace.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * ext/objspace/objspace.c: ditto. * ext/stringio/stringio.c: ditto. * ext/strscan/strscan.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/enumerator.c b/enumerator.c
index 012a5b036a..1c4d5072e0 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -168,6 +168,7 @@ static const rb_data_type_t enumerator_data_type = {
enumerator_free,
enumerator_memsize,
},
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static struct enumerator *
@@ -1076,6 +1077,7 @@ static const rb_data_type_t yielder_data_type = {
yielder_free,
yielder_memsize,
},
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static struct yielder *
@@ -1181,6 +1183,7 @@ static const rb_data_type_t generator_data_type = {
generator_free,
generator_memsize,
},
+ NULL, NULL, RUBY_TYPED_FREE_IMMEDIATELY
};
static struct generator *