зеркало из https://github.com/github/ruby.git
Add gc/gc.h for functions in gc.c and used by GC implementations
This commit is contained in:
Родитель
4b0244a1f3
Коммит
461a7b8316
|
@ -7238,6 +7238,7 @@ gc.$(OBJEXT): $(CCAN_DIR)/str/str.h
|
|||
gc.$(OBJEXT): $(hdrdir)/ruby.h
|
||||
gc.$(OBJEXT): $(hdrdir)/ruby/ruby.h
|
||||
gc.$(OBJEXT): $(hdrdir)/ruby/version.h
|
||||
gc.$(OBJEXT): $(top_srcdir)/gc/gc.h
|
||||
gc.$(OBJEXT): $(top_srcdir)/gc/gc_impl.h
|
||||
gc.$(OBJEXT): $(top_srcdir)/internal/array.h
|
||||
gc.$(OBJEXT): $(top_srcdir)/internal/basic_operators.h
|
||||
|
@ -7508,6 +7509,7 @@ gc_impl.$(OBJEXT): $(CCAN_DIR)/list/list.h
|
|||
gc_impl.$(OBJEXT): $(CCAN_DIR)/str/str.h
|
||||
gc_impl.$(OBJEXT): $(hdrdir)/ruby/ruby.h
|
||||
gc_impl.$(OBJEXT): $(top_srcdir)/gc/default.c
|
||||
gc_impl.$(OBJEXT): $(top_srcdir)/gc/gc.h
|
||||
gc_impl.$(OBJEXT): $(top_srcdir)/gc/gc_impl.h
|
||||
gc_impl.$(OBJEXT): $(top_srcdir)/internal/bits.h
|
||||
gc_impl.$(OBJEXT): $(top_srcdir)/internal/compilers.h
|
||||
|
|
30
gc.c
30
gc.c
|
@ -82,6 +82,7 @@
|
|||
#include "darray.h"
|
||||
#include "debug_counter.h"
|
||||
#include "eval_intern.h"
|
||||
#include "gc/gc.h"
|
||||
#include "gc/gc_impl.h"
|
||||
#include "id_table.h"
|
||||
#include "internal.h"
|
||||
|
@ -126,34 +127,6 @@
|
|||
#include "builtin.h"
|
||||
#include "shape.h"
|
||||
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
size_t rb_size_mul_or_raise(size_t, size_t, VALUE);
|
||||
bool rb_gc_obj_free(void *objspace, VALUE obj);
|
||||
size_t rb_gc_obj_optimal_size(VALUE obj);
|
||||
void rb_gc_mark_children(void *objspace, VALUE obj);
|
||||
void rb_gc_update_object_references(void *objspace, VALUE obj);
|
||||
void rb_gc_update_vm_references(void *objspace);
|
||||
void rb_gc_reachable_objects_from_callback(VALUE obj);
|
||||
void rb_gc_event_hook(VALUE obj, rb_event_flag_t event);
|
||||
void *rb_gc_get_objspace(void);
|
||||
size_t rb_size_mul_or_raise(size_t x, size_t y, VALUE exc);
|
||||
void rb_gc_run_obj_finalizer(VALUE objid, long count, VALUE (*callback)(long i, void *data), void *data);
|
||||
void rb_gc_set_pending_interrupt(void);
|
||||
void rb_gc_unset_pending_interrupt(void);
|
||||
bool rb_gc_obj_free(void *objspace, VALUE obj);
|
||||
void rb_gc_mark_roots(void *objspace, const char **categoryp);
|
||||
void rb_gc_ractor_newobj_cache_foreach(void (*func)(void *cache, void *data), void *data);
|
||||
bool rb_gc_multi_ractor_p(void);
|
||||
void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *passing_data);
|
||||
void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data);
|
||||
void rb_obj_info_dump(VALUE obj);
|
||||
const char *rb_obj_info(VALUE obj);
|
||||
bool rb_gc_shutdown_call_finalizer_p(VALUE obj);
|
||||
uint32_t rb_gc_get_shape(VALUE obj);
|
||||
void rb_gc_set_shape(VALUE obj, uint32_t shape_id);
|
||||
uint32_t rb_gc_rebuild_shape(VALUE obj, size_t size_pool_id);
|
||||
size_t rb_obj_memsize_of(VALUE obj);
|
||||
|
||||
unsigned int
|
||||
rb_gc_vm_lock(void)
|
||||
{
|
||||
|
@ -352,7 +325,6 @@ rb_gc_rebuild_shape(VALUE obj, size_t size_pool_id)
|
|||
|
||||
return (uint32_t)rb_shape_id(new_shape);
|
||||
}
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
void rb_vm_update_references(void *ptr);
|
||||
|
||||
|
|
36
gc/default.c
36
gc/default.c
|
@ -23,6 +23,7 @@
|
|||
#include "ruby/internal/encoding/string.h"
|
||||
#include "ccan/list/list.h"
|
||||
#include "darray.h"
|
||||
#include "gc/gc.h"
|
||||
#include "gc/gc_impl.h"
|
||||
#include "probes.h"
|
||||
|
||||
|
@ -67,41 +68,6 @@
|
|||
# include <mach/mach_port.h>
|
||||
#endif
|
||||
|
||||
/* Headers from gc.c */
|
||||
unsigned int rb_gc_vm_lock(void);
|
||||
void rb_gc_vm_unlock(unsigned int lev);
|
||||
unsigned int rb_gc_cr_lock(void);
|
||||
void rb_gc_cr_unlock(unsigned int lev);
|
||||
unsigned int rb_gc_vm_lock_no_barrier(void);
|
||||
void rb_gc_vm_unlock_no_barrier(unsigned int lev);
|
||||
void rb_gc_vm_barrier(void);
|
||||
size_t rb_gc_obj_optimal_size(VALUE obj);
|
||||
void rb_gc_mark_children(void *objspace, VALUE obj);
|
||||
void rb_gc_update_object_references(void *objspace, VALUE obj);
|
||||
void rb_gc_update_vm_references(void *objspace);
|
||||
void rb_gc_reachable_objects_from_callback(VALUE obj);
|
||||
void rb_gc_event_hook(VALUE obj, rb_event_flag_t event);
|
||||
void *rb_gc_get_objspace(void);
|
||||
size_t rb_size_mul_or_raise(size_t x, size_t y, VALUE exc);
|
||||
void rb_gc_run_obj_finalizer(VALUE objid, long count, VALUE (*callback)(long i, void *data), void *data);
|
||||
void rb_gc_set_pending_interrupt(void);
|
||||
void rb_gc_unset_pending_interrupt(void);
|
||||
bool rb_gc_obj_free(void *objspace, VALUE obj);
|
||||
void rb_gc_mark_roots(void *objspace, const char **categoryp);
|
||||
void rb_gc_ractor_newobj_cache_foreach(void (*func)(void *cache, void *data), void *data);
|
||||
bool rb_gc_multi_ractor_p(void);
|
||||
void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *passing_data);
|
||||
void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data);
|
||||
void rb_obj_info_dump(VALUE obj);
|
||||
const char *rb_obj_info(VALUE obj);
|
||||
bool rb_gc_shutdown_call_finalizer_p(VALUE obj);
|
||||
uint32_t rb_gc_get_shape(VALUE obj);
|
||||
void rb_gc_set_shape(VALUE obj, uint32_t shape_id);
|
||||
uint32_t rb_gc_rebuild_shape(VALUE obj, size_t size_pool_id);
|
||||
size_t rb_obj_memsize_of(VALUE obj);
|
||||
|
||||
void rb_ractor_finish_marking(void);
|
||||
|
||||
#ifndef VM_CHECK_MODE
|
||||
# define VM_CHECK_MODE RUBY_DEBUG
|
||||
#endif
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
#ifndef GC_GC_H
|
||||
#define GC_GC_H
|
||||
|
||||
#include "ruby/ruby.h"
|
||||
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
unsigned int rb_gc_vm_lock(void);
|
||||
void rb_gc_vm_unlock(unsigned int lev);
|
||||
unsigned int rb_gc_cr_lock(void);
|
||||
void rb_gc_cr_unlock(unsigned int lev);
|
||||
unsigned int rb_gc_vm_lock_no_barrier(void);
|
||||
void rb_gc_vm_unlock_no_barrier(unsigned int lev);
|
||||
void rb_gc_vm_barrier(void);
|
||||
size_t rb_gc_obj_optimal_size(VALUE obj);
|
||||
void rb_gc_mark_children(void *objspace, VALUE obj);
|
||||
void rb_gc_update_object_references(void *objspace, VALUE obj);
|
||||
void rb_gc_update_vm_references(void *objspace);
|
||||
void rb_gc_reachable_objects_from_callback(VALUE obj);
|
||||
void rb_gc_event_hook(VALUE obj, rb_event_flag_t event);
|
||||
void *rb_gc_get_objspace(void);
|
||||
size_t rb_size_mul_or_raise(size_t x, size_t y, VALUE exc);
|
||||
void rb_gc_run_obj_finalizer(VALUE objid, long count, VALUE (*callback)(long i, void *data), void *data);
|
||||
void rb_gc_set_pending_interrupt(void);
|
||||
void rb_gc_unset_pending_interrupt(void);
|
||||
bool rb_gc_obj_free(void *objspace, VALUE obj);
|
||||
void rb_gc_mark_roots(void *objspace, const char **categoryp);
|
||||
void rb_gc_ractor_newobj_cache_foreach(void (*func)(void *cache, void *data), void *data);
|
||||
bool rb_gc_multi_ractor_p(void);
|
||||
void rb_objspace_reachable_objects_from_root(void (func)(const char *category, VALUE, void *), void *passing_data);
|
||||
void rb_objspace_reachable_objects_from(VALUE obj, void (func)(VALUE, void *), void *data);
|
||||
void rb_obj_info_dump(VALUE obj);
|
||||
const char *rb_obj_info(VALUE obj);
|
||||
bool rb_gc_shutdown_call_finalizer_p(VALUE obj);
|
||||
uint32_t rb_gc_get_shape(VALUE obj);
|
||||
void rb_gc_set_shape(VALUE obj, uint32_t shape_id);
|
||||
uint32_t rb_gc_rebuild_shape(VALUE obj, size_t size_pool_id);
|
||||
size_t rb_obj_memsize_of(VALUE obj);
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
void rb_ractor_finish_marking(void);
|
||||
|
||||
#endif
|
Загрузка…
Ссылка в новой задаче