diff options
author | 卜部昌平 <[email protected]> | 2019-12-04 17:16:30 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2019-12-26 20:45:12 +0900 |
commit | 5e22f873ed26092522f9bfc617d729bac88b284f (patch) | |
tree | 8d66856526cd7efa87b46c966298e6f42d67e68f /gc.c | |
parent | 33e9601938a79dae149caa88ff1bc06d376dd376 (diff) |
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).
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2711
Diffstat (limited to 'gc.c')
-rw-r--r-- | gc.c | 105 |
1 files changed, 65 insertions, 40 deletions
@@ -14,43 +14,25 @@ #define rb_data_object_alloc rb_data_object_alloc #define rb_data_typed_object_alloc rb_data_typed_object_alloc -#include "ruby/encoding.h" -#include "ruby/io.h" -#include "ruby/st.h" -#include "ruby/re.h" -#include "ruby/thread.h" -#include "ruby/util.h" -#include "ruby/debug.h" -#include "internal.h" -#include "eval_intern.h" -#include "vm_core.h" -#include "builtin.h" -#include "gc.h" -#include "constant.h" -#include "ruby_atomic.h" -#include "probes.h" -#include "id_table.h" -#include "symbol.h" -#include <stdio.h> -#include <stdarg.h> -#include <setjmp.h> -#include <sys/types.h> -#include "ruby_assert.h" -#include "debug_counter.h" -#include "transient_heap.h" -#include "mjit.h" +#include "ruby/config.h" +#ifdef _WIN32 +# include "ruby/ruby.h" +#endif -#undef rb_data_object_wrap +#include <setjmp.h> +#include <stdarg.h> +#include <stdio.h> #ifndef HAVE_MALLOC_USABLE_SIZE # ifdef _WIN32 -# define HAVE_MALLOC_USABLE_SIZE -# define malloc_usable_size(a) _msize(a) +# define HAVE_MALLOC_USABLE_SIZE +# define malloc_usable_size(a) _msize(a) # elif defined HAVE_MALLOC_SIZE -# define HAVE_MALLOC_USABLE_SIZE -# define malloc_usable_size(a) malloc_size(a) +# define HAVE_MALLOC_USABLE_SIZE +# define malloc_usable_size(a) malloc_size(a) # endif #endif + #ifdef HAVE_MALLOC_USABLE_SIZE # ifdef RUBY_ALTERNATIVE_MALLOC_HEADER # include RUBY_ALTERNATIVE_MALLOC_HEADER @@ -64,28 +46,73 @@ #endif #ifdef HAVE_SYS_TIME_H -#include <sys/time.h> +# include <sys/time.h> #endif #ifdef HAVE_SYS_RESOURCE_H -#include <sys/resource.h> +# include <sys/resource.h> #endif #if defined _WIN32 || defined __CYGWIN__ -#include <windows.h> +# include <windows.h> #elif defined(HAVE_POSIX_MEMALIGN) #elif defined(HAVE_MEMALIGN) -#include <malloc.h> +# include <malloc.h> #endif -#define rb_setjmp(env) RUBY_SETJMP(env) -#define rb_jmp_buf rb_jmpbuf_t +#include <sys/types.h> #if defined(_MSC_VER) && defined(_WIN64) -#include <intrin.h> -#pragma intrinsic(_umul128) +# include <intrin.h> +# pragma intrinsic(_umul128) #endif +#include "constant.h" +#include "debug_counter.h" +#include "eval_intern.h" +#include "gc.h" +#include "id_table.h" +#include "internal.h" +#include "internal/class.h" +#include "internal/complex.h" +#include "internal/cont.h" +#include "internal/error.h" +#include "internal/eval.h" +#include "internal/gc.h" +#include "internal/hash.h" +#include "internal/imemo.h" +#include "internal/io.h" +#include "internal/numeric.h" +#include "internal/object.h" +#include "internal/proc.h" +#include "internal/rational.h" +#include "internal/sanitizers.h" +#include "internal/struct.h" +#include "internal/symbol.h" +#include "internal/thread.h" +#include "internal/variable.h" +#include "internal/warnings.h" +#include "mjit.h" +#include "probes.h" +#include "regint.h" +#include "ruby/debug.h" +#include "ruby/io.h" +#include "ruby/re.h" +#include "ruby/st.h" +#include "ruby/thread.h" +#include "ruby/util.h" +#include "ruby_assert.h" +#include "ruby_atomic.h" +#include "symbol.h" +#include "transient_heap.h" +#include "vm_core.h" + +#include "builtin.h" + +#define rb_setjmp(env) RUBY_SETJMP(env) +#define rb_jmp_buf rb_jmpbuf_t +#undef rb_data_object_wrap + /* Expecting this struct to be eliminated by function inlinings */ struct optional { bool left; @@ -3807,8 +3834,6 @@ rb_obj_id(VALUE obj) return rb_find_object_id(obj, cached_object_id); } -#include "regint.h" - static size_t obj_memsize_of(VALUE obj, int use_all_types) { |