Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* gc.c, gc.h (rb_objspace_marked_object_p): added.

  This function *ONLY* works just after marking phase,
  before any sweeping.
  This function is highly depending current GC implementation
  and can be removed future version.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit c6f2c9383f446f92e482a6e1c7e13772affde8d7 1 parent 5323328
@ko1 ko1 authored
Showing with 20 additions and 0 deletions.
  1. +8 −0 ChangeLog
  2. +11 −0 gc.c
  3. +1 −0  gc.h
View
8 ChangeLog
@@ -1,3 +1,11 @@
+Sat Feb 8 15:54:12 2014 Koichi Sasada <ko1@atdot.net>
+
+ * gc.c, gc.h (rb_objspace_marked_object_p): added.
+ This function *ONLY* works just after marking phase,
+ before any sweeping.
+ This function is highly depending current GC implementation
+ and can be removed future version.
+
Sat Feb 8 15:41:37 2014 Tanaka Akira <akr@fsij.org>
* lib/resolv.rb: Don't set CLOEXEC flag explicitly. (Ruby set it by
View
11 gc.c
@@ -3597,6 +3597,17 @@ rb_gc_mark(VALUE ptr)
gc_mark(&rb_objspace, ptr);
}
+/* CAUTION: THIS FUNCTION ENABLE *ONLY BEFORE* SWEEPING.
+ * This function is only for GC_END_MARK timing.
+ */
+
+int
+rb_objspace_marked_object_p(VALUE obj)
+{
+ rb_objspace_t *objspace = &rb_objspace;
+ return gc_marked(objspace, obj) ? TRUE : FALSE;
+}
+
/* resurrect non-marked `obj' if obj is before swept */
void
View
1  gc.h
@@ -91,6 +91,7 @@ void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), v
void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *data);
int rb_objspace_markable_object_p(VALUE obj);
int rb_objspace_internal_object_p(VALUE obj);
+int rb_objspace_marked_object_p(VALUE obj);
void rb_objspace_each_objects(
int (*callback)(void *start, void *end, size_t stride, void *data),
Please sign in to comment.
Something went wrong with that request. Please try again.