From 91515990c83ecda97c597fd498140896be0bc547 Mon Sep 17 00:00:00 2001 From: witekfl Date: Tue, 14 May 2013 15:36:32 +0200 Subject: [PATCH] Removed --with-gc and CONFIG_GC related code. CONFIG_GC was added with SEE, but SEE support was removed, so I don't see the reason to keep gc. --- Makefile.config.in | 1 - configure.in | 5 ----- src/main/main.c | 12 ------------ src/util/memdebug.c | 29 ----------------------------- src/util/memory.c | 16 ---------------- src/util/memory.h | 14 -------------- 6 files changed, 77 deletions(-) diff --git a/Makefile.config.in b/Makefile.config.in index e1531fb1..ada7e074 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -126,7 +126,6 @@ CONFIG_FINGER = @CONFIG_FINGER@ CONFIG_FORMHIST = @CONFIG_FORMHIST@ CONFIG_FSP = @CONFIG_FSP@ CONFIG_FTP = @CONFIG_FTP@ -CONFIG_GC = @CONFIG_GC@ CONFIG_GLOBHIST = @CONFIG_GLOBHIST@ CONFIG_GNUTLS = @CONFIG_GNUTLS@ CONFIG_GNUTLS_OPENSSL_COMPAT = @CONFIG_GNUTLS_OPENSSL_COMPAT@ diff --git a/configure.in b/configure.in index 023af06d..ecabb59e 100644 --- a/configure.in +++ b/configure.in @@ -484,11 +484,6 @@ EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_BZIP2, bzlib, bzlib.h, bz2, BZ2_bzReadOpen, EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version, [ --without-idn disable international domain names support]) -if test "x${with_gc}" != xno; then - EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_GC, gc, gc.h, gc, GC_init, - [ --with-gc enable Boehm's garbage collector]) -fi - # LZMA disabled by default, because of little usability and compilation problems # with new xz EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_LZMA, lzma, lzma.h, lzma, lzma_code, diff --git a/src/main/main.c b/src/main/main.c index 76f9285e..d7eb9dea 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -332,21 +332,9 @@ check_if_root(void) #define check_if_root() #endif -#ifdef CONFIG_GC -static void -gc_warning(char *msg, GC_word arg) -{ -} -#endif - - int main(int argc, char *argv[]) { -#ifdef CONFIG_GC - GC_INIT(); - GC_set_warn_proc(gc_warning); -#endif check_if_root(); program.terminate = 0; diff --git a/src/util/memdebug.c b/src/util/memdebug.c index 8551c523..1a9c3541 100644 --- a/src/util/memdebug.c +++ b/src/util/memdebug.c @@ -320,11 +320,7 @@ debug_mem_alloc(const unsigned char *file, int line, size_t size) true_size = SIZE_BASE2AH(size); do { -#ifdef CONFIG_GC - ah = GC_MALLOC(true_size); -#else ah = malloc(true_size); -#endif if (ah) break; } while (patience(file, line, "malloc")); if (!ah) return NULL; @@ -373,11 +369,7 @@ debug_mem_calloc(const unsigned char *file, int line, size_t eltcount, size_t el true_size = SIZE_BASE2AH(size); do { -#ifdef CONFIG_GC - ah = GC_MALLOC(true_size); -#else ah = calloc(1, true_size); -#endif if (ah) break; } while (patience(file, line, "calloc")); if (!ah) return NULL; @@ -459,11 +451,7 @@ debug_mem_free(const unsigned char *file, int line, void *ptr) if (ah->comment) { mem_stats.true_amount -= strlen(ah->comment) + 1; -#ifdef CONFIG_GC - ah->comment = NULL; -#else free(ah->comment); -#endif } del_from_list(ah); @@ -477,12 +465,7 @@ debug_mem_free(const unsigned char *file, int line, void *ptr) #ifdef CHECK_DOUBLE_FREE ah->magic = AH_FREE_MAGIC; #endif - -#ifdef CONFIG_GC - ah = NULL; -#else free(ah); -#endif } void * @@ -519,11 +502,7 @@ debug_mem_realloc(const unsigned char *file, int line, void *ptr, size_t size) true_size = SIZE_BASE2AH(size); do { -#ifdef CONFIG_GC - ah2 = GC_REALLOC(ah, true_size); -#else ah2 = realloc(ah, true_size); -#endif if (ah2) { ah = ah2; break; @@ -567,17 +546,9 @@ set_mem_comment(void *ptr, const unsigned char *str, int len) if (ah->comment) { mem_stats.true_amount -= strlen(ah->comment) + 1; -#ifdef CONFIG_GC - ah->comment = NULL; -#else free(ah->comment); -#endif } -#ifdef CONFIG_GC - ah->comment = GC_MALLOC(len + 1); -#else ah->comment = malloc(len + 1); -#endif if (ah->comment) { memcpy(ah->comment, str, len); ah->comment[len] = 0; diff --git a/src/util/memory.c b/src/util/memory.c index 4a067adb..5c1a03d2 100644 --- a/src/util/memory.c +++ b/src/util/memory.c @@ -56,11 +56,7 @@ mem_alloc(size_t size) { if (size) do { -#ifdef CONFIG_GC - void *p = GC_MALLOC(size); -#else void *p = malloc(size); -#endif if (p) return p; } while (patience("malloc")); @@ -72,11 +68,7 @@ mem_calloc(size_t count, size_t eltsize) { if (eltsize && count) do { -#ifdef CONFIG_GC - void *p = GC_MALLOC(count * eltsize); -#else void *p = calloc(count, eltsize); -#endif if (p) return p; } while (patience("calloc")); @@ -90,11 +82,7 @@ mem_free(void *p) INTERNAL("mem_free(NULL)"); return; } -#ifdef CONFIG_GC - p = NULL; -#else free(p); -#endif } void * @@ -104,11 +92,7 @@ mem_realloc(void *p, size_t size) if (size) do { -#ifdef CONFIG_GC - void *p2 = GC_REALLOC(p, size); -#else void *p2 = realloc(p, size); -#endif if (p2) return p2; } while (patience("realloc")); else diff --git a/src/util/memory.h b/src/util/memory.h index 9da756cc..cb8d01ca 100644 --- a/src/util/memory.h +++ b/src/util/memory.h @@ -20,10 +20,6 @@ #include #include -#ifdef CONFIG_GC -#include -#endif - #ifdef HAVE_MMAP void *mem_mmap_alloc(size_t size); void mem_mmap_free(void *p, size_t size); @@ -66,21 +62,11 @@ void *mem_realloc(void *, size_t); * For these we need some replacement functions. * This should not be an issue on most modern systems. */ -#ifdef CONFIG_GC -# define mem_alloc(size) GC_MALLOC(size) -# define mem_calloc(count, size) GC_MALLOC((count) * (size)) -# define mem_free(p) (p) = NULL -# define mem_realloc(p, size) GC_REALLOC(p, size) - -#else - # define mem_alloc(size) malloc(size) # define mem_calloc(count, size) calloc(count, size) # define mem_free(p) free(p) # define mem_realloc(p, size) realloc(p, size) -#endif - /* fmem_* functions should be use for allocation and freeing of memory * inside a function. * See alloca(3) manpage. */