diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-09-26 09:48:39 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-09-26 15:49:18 +0300 |
commit | 8c5f0fc6c63a804c00a001dd093c0fa998b01485 (patch) | |
tree | c931f04780775547d81dac316e6e7c6f12f1c07a | |
parent | e6061ac46dc1ab64cdb747ce55baf6320bc08866 (diff) | |
download | bdwgc-8c5f0fc6c63a804c00a001dd093c0fa998b01485.tar.gz |
Include stdio.h and stdlib.h only from gc_priv.h
(refactoring)
* allchblk.c: Do not include stdio.h directly.
* alloc.c: Likewise.
* dyn_load.c [(DYNAMIC_LOADING || MSWIN32 || MSWINCE || CYGWIN32)
&& !PCR]: Likewise.
* mach_dep.c [!PLATFORM_MACH_DEP && !SN_TARGET_PSP2]: Likewise.
* malloc.c: Likewise.
* mallocx.c: Likewise.
* mark.c: Likewise.
* mark_rts.c: Likewise.
* misc.c: Likewise.
* new_hblk.c: Likewise.
* os_dep.c: Likewise.
* reclaim.c: Likewise.
* tests/disclaim_bench.c: Likewise.
* tests/gctest.c: Likewise.
* dbg_mlc.c [KEEP_BACK_PTRS && !LINT2]: Do not include stdlib.h
directly.
* dyn_load.c [MSWIN32 || MSWINCE || CYGWIN32]: Likewise.
* os_dep.c [HAIKU]: Likewise.
* pthread_support.c [GC_PTHREADS && !GC_WIN32_THREADS]: Likewise.
* tests/disclaim_bench.c: Likewise.
* tests/gctest.c [!mips || !SYSTYPE_BSD43]: Likewise.
* thread_local_alloc.c: Likewise.
* include/private/gc_priv.h: Include stdio.h.
-rw-r--r-- | allchblk.c | 2 | ||||
-rw-r--r-- | alloc.c | 1 | ||||
-rw-r--r-- | dbg_mlc.c | 1 | ||||
-rw-r--r-- | dyn_load.c | 3 | ||||
-rw-r--r-- | include/private/gc_priv.h | 2 | ||||
-rw-r--r-- | mach_dep.c | 2 | ||||
-rw-r--r-- | malloc.c | 1 | ||||
-rw-r--r-- | mallocx.c | 1 | ||||
-rw-r--r-- | mark.c | 2 | ||||
-rw-r--r-- | mark_rts.c | 2 | ||||
-rw-r--r-- | misc.c | 1 | ||||
-rw-r--r-- | new_hblk.c | 2 | ||||
-rw-r--r-- | os_dep.c | 2 | ||||
-rw-r--r-- | pthread_support.c | 1 | ||||
-rw-r--r-- | reclaim.c | 2 | ||||
-rw-r--r-- | tests/disclaim_bench.c | 2 | ||||
-rw-r--r-- | tests/gctest.c | 6 | ||||
-rw-r--r-- | thread_local_alloc.c | 2 |
18 files changed, 2 insertions, 33 deletions
@@ -17,8 +17,6 @@ #include "private/gc_priv.h" -#include <stdio.h> - #ifdef GC_USE_ENTIRE_HEAP int GC_use_entire_heap = TRUE; #else @@ -18,7 +18,6 @@ #include "private/gc_priv.h" -#include <stdio.h> #if !defined(MACOS) && !defined(MSWINCE) # include <signal.h> # if !defined(GC_NO_TYPES) && !defined(SN_TARGET_PSP2) \ @@ -67,7 +67,6 @@ # define RANDOM() (long)GC_rand() #else -# include <stdlib.h> # undef GC_RAND_MAX # define GC_RAND_MAX RAND_MAX @@ -68,7 +68,6 @@ STATIC GC_has_static_roots_func GC_has_static_roots = 0; # error Additional SVR4 variants might not be too hard to add. #endif -#include <stdio.h> #ifdef SOLARISDL # include <sys/elf.h> # include <dlfcn.h> @@ -937,8 +936,6 @@ GC_INNER void GC_register_dynamic_libraries(void) # if defined(MSWIN32) || defined(MSWINCE) || defined(CYGWIN32) -# include <stdlib.h> - /* We traverse the entire address space and register all segments */ /* that could possibly have been written to. */ STATIC void GC_cond_add_roots(char *base, char * limit) diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 6d7d9c25..903d8b59 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -835,6 +835,8 @@ EXTERN_C_END #include <setjmp.h> +#include <stdio.h> + #if __STDC_VERSION__ >= 201112L # include <assert.h> /* for static_assert */ #endif @@ -17,8 +17,6 @@ #if !defined(PLATFORM_MACH_DEP) && !defined(SN_TARGET_PSP2) -#include <stdio.h> - #ifdef AMIGA # ifndef __GNUC__ # include <dos.h> @@ -17,7 +17,6 @@ #include "private/gc_priv.h" #include "gc/gc_inline.h" /* for GC_malloc_kind */ -#include <stdio.h> #include <string.h> /* Allocate reclaim list for the kind. Returns TRUE on success. */ @@ -25,7 +25,6 @@ * executables. We should probably break this up further. */ -#include <stdio.h> #include <string.h> #ifndef MSWINCE @@ -27,8 +27,6 @@ #include "private/gc_pmark.h" -#include <stdio.h> - #if defined(MSWIN32) && defined(__GNUC__) # include <excpt.h> #endif @@ -15,8 +15,6 @@ #include "private/gc_priv.h" -#include <stdio.h> - /* Data structure for list of root sets. */ /* We keep a hash table, so that we can filter out duplicate additions. */ /* Under Win32, we need to do a better job of filtering overlaps, so */ @@ -16,7 +16,6 @@ #include "private/gc_pmark.h" -#include <stdio.h> #include <limits.h> #include <stdarg.h> @@ -21,8 +21,6 @@ * void GC_new_hblk(size, kind) */ -#include <stdio.h> - #ifndef SMALL_CONFIG /* Build a free list for size 2 (words) cleared objects inside */ /* hblk h. Set the last link to be ofl. Return a pointer to the */ @@ -26,7 +26,6 @@ # endif #endif -#include <stdio.h> #if defined(MSWINCE) || defined(SN_TARGET_PS3) # define SIGSEGV 0 /* value is irrelevant */ #else @@ -2549,7 +2548,6 @@ void * os2_alloc(size_t bytes) #endif #if defined(HAIKU) -# include <stdlib.h> ptr_t GC_haiku_get_mem(size_t bytes) { void* mem; diff --git a/pthread_support.c b/pthread_support.c index a45368a8..a344cc18 100644 --- a/pthread_support.c +++ b/pthread_support.c @@ -30,7 +30,6 @@ #if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS) -# include <stdlib.h> # include <pthread.h> # include <sched.h> # include <time.h> @@ -21,8 +21,6 @@ # include "gc/gc_disclaim.h" #endif -#include <stdio.h> - GC_INNER signed_word GC_bytes_found = 0; /* Number of bytes of memory reclaimed */ /* minus the number of bytes originally */ diff --git a/tests/disclaim_bench.c b/tests/disclaim_bench.c index 58f447e6..8525063d 100644 --- a/tests/disclaim_bench.c +++ b/tests/disclaim_bench.c @@ -12,8 +12,6 @@ * */ -#include <stdlib.h> -#include <stdio.h> #include <string.h> #ifdef HAVE_CONFIG_H diff --git a/tests/gctest.c b/tests/gctest.c index 2b2b86a2..aefbaf93 100644 --- a/tests/gctest.c +++ b/tests/gctest.c @@ -47,12 +47,6 @@ /* In the single-threaded case, the number of times to rerun it. */ #endif -# if defined(mips) && defined(SYSTYPE_BSD43) - /* MIPS RISCOS 4 */ -# else -# include <stdlib.h> -# endif -# include <stdio.h> # if defined(_WIN32_WCE) && !defined(__GNUC__) # include <winbase.h> /* # define assert ASSERT */ diff --git a/thread_local_alloc.c b/thread_local_alloc.c index bb2c2b4e..f127b105 100644 --- a/thread_local_alloc.c +++ b/thread_local_alloc.c @@ -22,8 +22,6 @@ #include "private/thread_local_alloc.h" -#include <stdlib.h> - #if defined(USE_COMPILER_TLS) __thread GC_ATTR_TLS_FAST #elif defined(USE_WIN32_COMPILER_TLS) |