From 5e22f873ed26092522f9bfc617d729bac88b284f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Wed, 4 Dec 2019 17:16:30 +0900 Subject: decouple internal.h headers Saves comitters' daily life by avoid #include-ing everything from internal.h to make each file do so instead. This would significantly speed up incremental builds. We take the following inclusion order in this changeset: 1. "ruby/config.h", where _GNU_SOURCE is defined (must be the very first thing among everything). 2. RUBY_EXTCONF_H if any. 3. Standard C headers, sorted alphabetically. 4. Other system headers, maybe guarded by #ifdef 5. Everything else, sorted alphabetically. Exceptions are those win32-related headers, which tend not be self- containing (headers have inclusion order dependencies). --- vm_core.h | 62 +++++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 27 deletions(-) (limited to 'vm_core.h') diff --git a/vm_core.h b/vm_core.h index 12c3ac3775..8807c23b6f 100644 --- a/vm_core.h +++ b/vm_core.h @@ -46,6 +46,19 @@ #define VMDEBUG 3 #endif +#include "ruby/config.h" + +#include +#include + +#ifdef HAVE_STDARG_PROTOTYPES +#include +#define va_init_list(a,b) va_start((a),(b)) +#else +#include +#define va_init_list(a,b) va_start((a)) +#endif + #include "ruby_assert.h" #if VM_CHECK_MODE > 0 @@ -57,27 +70,21 @@ #define VM_UNREACHABLE(func) UNREACHABLE #endif -#define RUBY_VM_THREAD_MODEL 2 - -/* - * implementation selector of get_insn_info algorithm - * 0: linear search - * 1: binary search - * 2: succinct bitvector - */ -#ifndef VM_INSN_INFO_TABLE_IMPL -# define VM_INSN_INFO_TABLE_IMPL 2 -#endif - -#include "ruby/ruby.h" -#include "ruby/st.h" +#include -#include "node.h" -#include "vm_opts.h" #include "id.h" +#include "internal.h" +#include "internal/array.h" +#include "internal/serial.h" +#include "internal/stdbool.h" +#include "ccan/list/list.h" +#include "internal/vm.h" #include "method.h" +#include "node.h" +#include "ruby/ruby.h" +#include "ruby/st.h" #include "ruby_atomic.h" -#include "ccan/list/list.h" +#include "vm_opts.h" #include "ruby/thread_native.h" #if defined(_WIN32) @@ -86,8 +93,17 @@ #include "thread_pthread.h" #endif -#include -#include +#define RUBY_VM_THREAD_MODEL 2 + +/* + * implementation selector of get_insn_info algorithm + * 0: linear search + * 1: binary search + * 2: succinct bitvector + */ +#ifndef VM_INSN_INFO_TABLE_IMPL +# define VM_INSN_INFO_TABLE_IMPL 2 +#endif #if defined(NSIG_MAX) /* POSIX issue 8 */ # undef NSIG @@ -123,14 +139,6 @@ /* define to 0 to test old code path */ #define WAITPID_USE_SIGCHLD (RUBY_SIGCHLD || SIGCHLD_LOSSY) -#ifdef HAVE_STDARG_PROTOTYPES -#include -#define va_init_list(a,b) va_start((a),(b)) -#else -#include -#define va_init_list(a,b) va_start((a)) -#endif - #if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__) # define USE_SIGALTSTACK void *rb_register_sigaltstack(void); -- cgit v1.2.3