aboutsummaryrefslogtreecommitdiffstats
path: root/vm_core.h
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-12-04 17:16:30 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-12-26 20:45:12 +0900
commit5e22f873ed26092522f9bfc617d729bac88b284f (patch)
tree8d66856526cd7efa87b46c966298e6f42d67e68f /vm_core.h
parent33e9601938a79dae149caa88ff1bc06d376dd376 (diff)
downloadruby-5e22f873ed26092522f9bfc617d729bac88b284f.tar.gz
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).
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h62
1 files changed, 35 insertions, 27 deletions
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 <stddef.h>
+#include <signal.h>
+
+#ifdef HAVE_STDARG_PROTOTYPES
+#include <stdarg.h>
+#define va_init_list(a,b) va_start((a),(b))
+#else
+#include <varargs.h>
+#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 <setjmp.h>
-#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 <setjmp.h>
-#include <signal.h>
+#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 <stdarg.h>
-#define va_init_list(a,b) va_start((a),(b))
-#else
-#include <varargs.h>
-#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);