mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
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.
This commit is contained in:
parent
7dd4d9b737
commit
91515990c8
@ -126,7 +126,6 @@ CONFIG_FINGER = @CONFIG_FINGER@
|
|||||||
CONFIG_FORMHIST = @CONFIG_FORMHIST@
|
CONFIG_FORMHIST = @CONFIG_FORMHIST@
|
||||||
CONFIG_FSP = @CONFIG_FSP@
|
CONFIG_FSP = @CONFIG_FSP@
|
||||||
CONFIG_FTP = @CONFIG_FTP@
|
CONFIG_FTP = @CONFIG_FTP@
|
||||||
CONFIG_GC = @CONFIG_GC@
|
|
||||||
CONFIG_GLOBHIST = @CONFIG_GLOBHIST@
|
CONFIG_GLOBHIST = @CONFIG_GLOBHIST@
|
||||||
CONFIG_GNUTLS = @CONFIG_GNUTLS@
|
CONFIG_GNUTLS = @CONFIG_GNUTLS@
|
||||||
CONFIG_GNUTLS_OPENSSL_COMPAT = @CONFIG_GNUTLS_OPENSSL_COMPAT@
|
CONFIG_GNUTLS_OPENSSL_COMPAT = @CONFIG_GNUTLS_OPENSSL_COMPAT@
|
||||||
|
@ -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,
|
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_IDN, idn, idna.h, idn, stringprep_check_version,
|
||||||
[ --without-idn disable international domain names support])
|
[ --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
|
# LZMA disabled by default, because of little usability and compilation problems
|
||||||
# with new xz
|
# with new xz
|
||||||
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_LZMA, lzma, lzma.h, lzma, lzma_code,
|
EL_CONFIG_OPTIONAL_LIBRARY(CONFIG_LZMA, lzma, lzma.h, lzma, lzma_code,
|
||||||
|
@ -332,21 +332,9 @@ check_if_root(void)
|
|||||||
#define check_if_root()
|
#define check_if_root()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_GC
|
|
||||||
static void
|
|
||||||
gc_warning(char *msg, GC_word arg)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_GC
|
|
||||||
GC_INIT();
|
|
||||||
GC_set_warn_proc(gc_warning);
|
|
||||||
#endif
|
|
||||||
check_if_root();
|
check_if_root();
|
||||||
|
|
||||||
program.terminate = 0;
|
program.terminate = 0;
|
||||||
|
@ -320,11 +320,7 @@ debug_mem_alloc(const unsigned char *file, int line, size_t size)
|
|||||||
|
|
||||||
true_size = SIZE_BASE2AH(size);
|
true_size = SIZE_BASE2AH(size);
|
||||||
do {
|
do {
|
||||||
#ifdef CONFIG_GC
|
|
||||||
ah = GC_MALLOC(true_size);
|
|
||||||
#else
|
|
||||||
ah = malloc(true_size);
|
ah = malloc(true_size);
|
||||||
#endif
|
|
||||||
if (ah) break;
|
if (ah) break;
|
||||||
} while (patience(file, line, "malloc"));
|
} while (patience(file, line, "malloc"));
|
||||||
if (!ah) return NULL;
|
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);
|
true_size = SIZE_BASE2AH(size);
|
||||||
do {
|
do {
|
||||||
#ifdef CONFIG_GC
|
|
||||||
ah = GC_MALLOC(true_size);
|
|
||||||
#else
|
|
||||||
ah = calloc(1, true_size);
|
ah = calloc(1, true_size);
|
||||||
#endif
|
|
||||||
if (ah) break;
|
if (ah) break;
|
||||||
} while (patience(file, line, "calloc"));
|
} while (patience(file, line, "calloc"));
|
||||||
if (!ah) return NULL;
|
if (!ah) return NULL;
|
||||||
@ -459,11 +451,7 @@ debug_mem_free(const unsigned char *file, int line, void *ptr)
|
|||||||
|
|
||||||
if (ah->comment) {
|
if (ah->comment) {
|
||||||
mem_stats.true_amount -= strlen(ah->comment) + 1;
|
mem_stats.true_amount -= strlen(ah->comment) + 1;
|
||||||
#ifdef CONFIG_GC
|
|
||||||
ah->comment = NULL;
|
|
||||||
#else
|
|
||||||
free(ah->comment);
|
free(ah->comment);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
del_from_list(ah);
|
del_from_list(ah);
|
||||||
@ -477,12 +465,7 @@ debug_mem_free(const unsigned char *file, int line, void *ptr)
|
|||||||
#ifdef CHECK_DOUBLE_FREE
|
#ifdef CHECK_DOUBLE_FREE
|
||||||
ah->magic = AH_FREE_MAGIC;
|
ah->magic = AH_FREE_MAGIC;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_GC
|
|
||||||
ah = NULL;
|
|
||||||
#else
|
|
||||||
free(ah);
|
free(ah);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
@ -519,11 +502,7 @@ debug_mem_realloc(const unsigned char *file, int line, void *ptr, size_t size)
|
|||||||
|
|
||||||
true_size = SIZE_BASE2AH(size);
|
true_size = SIZE_BASE2AH(size);
|
||||||
do {
|
do {
|
||||||
#ifdef CONFIG_GC
|
|
||||||
ah2 = GC_REALLOC(ah, true_size);
|
|
||||||
#else
|
|
||||||
ah2 = realloc(ah, true_size);
|
ah2 = realloc(ah, true_size);
|
||||||
#endif
|
|
||||||
if (ah2) {
|
if (ah2) {
|
||||||
ah = ah2;
|
ah = ah2;
|
||||||
break;
|
break;
|
||||||
@ -567,17 +546,9 @@ set_mem_comment(void *ptr, const unsigned char *str, int len)
|
|||||||
|
|
||||||
if (ah->comment) {
|
if (ah->comment) {
|
||||||
mem_stats.true_amount -= strlen(ah->comment) + 1;
|
mem_stats.true_amount -= strlen(ah->comment) + 1;
|
||||||
#ifdef CONFIG_GC
|
|
||||||
ah->comment = NULL;
|
|
||||||
#else
|
|
||||||
free(ah->comment);
|
free(ah->comment);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_GC
|
|
||||||
ah->comment = GC_MALLOC(len + 1);
|
|
||||||
#else
|
|
||||||
ah->comment = malloc(len + 1);
|
ah->comment = malloc(len + 1);
|
||||||
#endif
|
|
||||||
if (ah->comment) {
|
if (ah->comment) {
|
||||||
memcpy(ah->comment, str, len);
|
memcpy(ah->comment, str, len);
|
||||||
ah->comment[len] = 0;
|
ah->comment[len] = 0;
|
||||||
|
@ -56,11 +56,7 @@ mem_alloc(size_t size)
|
|||||||
{
|
{
|
||||||
if (size)
|
if (size)
|
||||||
do {
|
do {
|
||||||
#ifdef CONFIG_GC
|
|
||||||
void *p = GC_MALLOC(size);
|
|
||||||
#else
|
|
||||||
void *p = malloc(size);
|
void *p = malloc(size);
|
||||||
#endif
|
|
||||||
if (p) return p;
|
if (p) return p;
|
||||||
} while (patience("malloc"));
|
} while (patience("malloc"));
|
||||||
|
|
||||||
@ -72,11 +68,7 @@ mem_calloc(size_t count, size_t eltsize)
|
|||||||
{
|
{
|
||||||
if (eltsize && count)
|
if (eltsize && count)
|
||||||
do {
|
do {
|
||||||
#ifdef CONFIG_GC
|
|
||||||
void *p = GC_MALLOC(count * eltsize);
|
|
||||||
#else
|
|
||||||
void *p = calloc(count, eltsize);
|
void *p = calloc(count, eltsize);
|
||||||
#endif
|
|
||||||
if (p) return p;
|
if (p) return p;
|
||||||
} while (patience("calloc"));
|
} while (patience("calloc"));
|
||||||
|
|
||||||
@ -90,11 +82,7 @@ mem_free(void *p)
|
|||||||
INTERNAL("mem_free(NULL)");
|
INTERNAL("mem_free(NULL)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_GC
|
|
||||||
p = NULL;
|
|
||||||
#else
|
|
||||||
free(p);
|
free(p);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
@ -104,11 +92,7 @@ mem_realloc(void *p, size_t size)
|
|||||||
|
|
||||||
if (size)
|
if (size)
|
||||||
do {
|
do {
|
||||||
#ifdef CONFIG_GC
|
|
||||||
void *p2 = GC_REALLOC(p, size);
|
|
||||||
#else
|
|
||||||
void *p2 = realloc(p, size);
|
void *p2 = realloc(p, size);
|
||||||
#endif
|
|
||||||
if (p2) return p2;
|
if (p2) return p2;
|
||||||
} while (patience("realloc"));
|
} while (patience("realloc"));
|
||||||
else
|
else
|
||||||
|
@ -20,10 +20,6 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#ifdef CONFIG_GC
|
|
||||||
#include <gc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_MMAP
|
#ifdef HAVE_MMAP
|
||||||
void *mem_mmap_alloc(size_t size);
|
void *mem_mmap_alloc(size_t size);
|
||||||
void mem_mmap_free(void *p, 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.
|
* For these we need some replacement functions.
|
||||||
* This should not be an issue on most modern systems.
|
* 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_alloc(size) malloc(size)
|
||||||
# define mem_calloc(count, size) calloc(count, size)
|
# define mem_calloc(count, size) calloc(count, size)
|
||||||
# define mem_free(p) free(p)
|
# define mem_free(p) free(p)
|
||||||
# define mem_realloc(p, size) realloc(p, size)
|
# define mem_realloc(p, size) realloc(p, size)
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* fmem_* functions should be use for allocation and freeing of memory
|
/* fmem_* functions should be use for allocation and freeing of memory
|
||||||
* inside a function.
|
* inside a function.
|
||||||
* See alloca(3) manpage. */
|
* See alloca(3) manpage. */
|
||||||
|
Loading…
Reference in New Issue
Block a user