зеркало из https://github.com/github/ruby.git
rb_source_location_cstr is banned in this file
Raison d'etre du gc_impl.c is to purge any internal constructs and rely solely on our public APIs. rb_source_location_cstr is not public.
This commit is contained in:
Родитель
1f15149e98
Коммит
c49eda91bf
20
gc_impl.c
20
gc_impl.c
|
@ -2337,6 +2337,24 @@ newobj_fill(VALUE obj, VALUE v1, VALUE v2, VALUE v3)
|
|||
return obj;
|
||||
}
|
||||
|
||||
#ifdef GC_DEBUG
|
||||
static inline const char*
|
||||
rb_gc_impl_source_location_cstr(int *ptr)
|
||||
{
|
||||
/* We could directly refer `rb_source_location_cstr()` before, but not any
|
||||
* longer. We have to heavy lift using our debugging API. */
|
||||
if (! ptr) {
|
||||
return NULL;
|
||||
}
|
||||
else if (! (*ptr = rb_sourceline())) {
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
return rb_sourcefile();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline VALUE
|
||||
newobj_init(VALUE klass, VALUE flags, int wb_protected, rb_objspace_t *objspace, VALUE obj)
|
||||
{
|
||||
|
@ -2394,7 +2412,7 @@ newobj_init(VALUE klass, VALUE flags, int wb_protected, rb_objspace_t *objspace,
|
|||
#endif
|
||||
|
||||
#if GC_DEBUG
|
||||
GET_RVALUE_OVERHEAD(obj)->file = rb_source_location_cstr(&GET_RVALUE_OVERHEAD(obj)->line);
|
||||
GET_RVALUE_OVERHEAD(obj)->file = rb_gc_impl_source_location_cstr(&GET_RVALUE_OVERHEAD(obj)->line);
|
||||
GC_ASSERT(!SPECIAL_CONST_P(obj)); /* check alignment */
|
||||
#endif
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче