mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Separate builtin initialization calls
This commit is contained in:
parent
8ce5d46e66
commit
d7bef803ac
Notes:
git
2019-12-29 12:35:17 +09:00
8 changed files with 14 additions and 27 deletions
2
ast.c
2
ast.c
|
@ -690,6 +690,4 @@ Init_ast(void)
|
|||
rb_mAST = rb_define_module_under(rb_cRubyVM, "AbstractSyntaxTree");
|
||||
rb_cNode = rb_define_class_under(rb_mAST, "Node", rb_cObject);
|
||||
rb_undef_alloc_func(rb_cNode);
|
||||
|
||||
load_ast();
|
||||
}
|
||||
|
|
6
error.c
6
error.c
|
@ -3077,12 +3077,6 @@ Init_syserr(void)
|
|||
|
||||
#include "warning.rbinc"
|
||||
|
||||
void
|
||||
Init_warning(void)
|
||||
{
|
||||
load_warning();
|
||||
}
|
||||
|
||||
/*!
|
||||
* \}
|
||||
*/
|
||||
|
|
1
gc.c
1
gc.c
|
@ -11868,7 +11868,6 @@ Init_GC(void)
|
|||
VALUE gc_constants;
|
||||
|
||||
rb_mGC = rb_define_module("GC");
|
||||
load_gc();
|
||||
|
||||
gc_constants = rb_hash_new();
|
||||
rb_hash_aset(gc_constants, ID2SYM(rb_intern("RVALUE_SIZE")), SIZET2NUM(sizeof(RVALUE)));
|
||||
|
|
20
inits.c
20
inits.c
|
@ -12,6 +12,7 @@
|
|||
#include "internal/inits.h"
|
||||
#include "ruby.h"
|
||||
#include "builtin.h"
|
||||
static void Init_builtin_prelude(void);
|
||||
#include "prelude.rbinc"
|
||||
|
||||
#define CALL(n) {void Init_##n(void); Init_##n();}
|
||||
|
@ -45,6 +46,7 @@ rb_call_inits(void)
|
|||
CALL(Hash);
|
||||
CALL(Struct);
|
||||
CALL(Regexp);
|
||||
CALL(pack);
|
||||
CALL(transcode);
|
||||
CALL(marshal);
|
||||
CALL(Range);
|
||||
|
@ -57,6 +59,7 @@ rb_call_inits(void)
|
|||
CALL(Proc);
|
||||
CALL(Binding);
|
||||
CALL(Math);
|
||||
CALL(GC);
|
||||
CALL(Enumerator);
|
||||
CALL(VM);
|
||||
CALL(ISeq);
|
||||
|
@ -66,18 +69,21 @@ rb_call_inits(void)
|
|||
CALL(Rational);
|
||||
CALL(Complex);
|
||||
CALL(version);
|
||||
CALL(vm_trace);
|
||||
CALL(vm_stack_canary);
|
||||
CALL(ast);
|
||||
CALL(gc_stress);
|
||||
|
||||
// enable builtin loading
|
||||
CALL(builtin);
|
||||
|
||||
CALL(GC);
|
||||
CALL(IO_nonblock);
|
||||
CALL(ast);
|
||||
CALL(vm_trace);
|
||||
CALL(pack);
|
||||
CALL(warning);
|
||||
load_prelude();
|
||||
#define BUILTIN(n) CALL(builtin_##n)
|
||||
BUILTIN(gc);
|
||||
BUILTIN(io);
|
||||
BUILTIN(ast);
|
||||
BUILTIN(trace_point);
|
||||
BUILTIN(pack);
|
||||
BUILTIN(warning);
|
||||
Init_builtin_prelude();
|
||||
}
|
||||
#undef CALL
|
||||
|
|
6
io.c
6
io.c
|
@ -13522,9 +13522,3 @@ Init_IO(void)
|
|||
}
|
||||
|
||||
#include "io.rbinc"
|
||||
|
||||
void
|
||||
Init_IO_nonblock(void)
|
||||
{
|
||||
load_io();
|
||||
}
|
||||
|
|
2
pack.c
2
pack.c
|
@ -1767,7 +1767,5 @@ utf8_to_uv(const char *p, long *lenp)
|
|||
void
|
||||
Init_pack(void)
|
||||
{
|
||||
load_pack();
|
||||
|
||||
id_associated = rb_make_internal_id();
|
||||
}
|
||||
|
|
|
@ -166,7 +166,7 @@ def mk_builtin_header file
|
|||
end
|
||||
}
|
||||
|
||||
f.puts "static void load_#{base}(void)"
|
||||
f.puts "void Init_builtin_#{base}(void)"
|
||||
f.puts "{"
|
||||
|
||||
table = "#{base}_table"
|
||||
|
|
|
@ -1526,8 +1526,6 @@ Init_vm_trace(void)
|
|||
|
||||
rb_cTracePoint = rb_define_class("TracePoint", rb_cObject);
|
||||
rb_undef_alloc_func(rb_cTracePoint);
|
||||
|
||||
load_trace_point();
|
||||
}
|
||||
|
||||
typedef struct rb_postponed_job_struct {
|
||||
|
|
Loading…
Reference in a new issue