Commit: 307f294e8de4f8c9f5fb26a20083808cc2d6dd62
Parent: 6cc9d482509bc8f47bb1a70e3e74880b2e24bc5b
Author: opask
Date: Wed, 25 Jul 2018 00:13:32 -0600
remove unused code
Diffstat:
4 files changed, 2 insertions(+), 26 deletions(-)
diff --git a/cache.c b/cache.c
@@ -198,7 +198,7 @@ static void mem_free_fragment(struct fragment *f)
int page_size = 4096;
-#define C_ALIGN(x) ((((x) + sizeof(struct fragment) + alloc_overhead) | (page_size - 1)) - sizeof(struct fragment) - alloc_overhead)
+#define C_ALIGN(x) ((((x) + sizeof(struct fragment)) | (page_size - 1)) - sizeof(struct fragment))
int add_fragment(struct cache_entry *e, off_t offset, const unsigned char *data, off_t length)
{
diff --git a/error.c b/error.c
@@ -5,12 +5,6 @@
#include "links.h"
-#ifdef RED_ZONE
-#define RED_ZONE_INC 1
-#else
-#define RED_ZONE_INC 0
-#endif
-
volatile char dummy_val;
volatile char * volatile dummy_ptr = &dummy_val;
volatile char * volatile x_ptr;
@@ -23,12 +17,6 @@ void *do_not_optimize_here(void *p)
return p;
}
-#define heap_calloc(x) calloc(1, (x))
-void init_heap(void)
-{
-}
-#define exit_heap() do { } while (0)
-
static inline void force_dump(void)
{
int rs;
@@ -38,11 +26,6 @@ static inline void force_dump(void)
EINTRLOOP(rs, raise(SIGSEGV));
}
-void check_memory_leaks(void)
-{
- exit_heap();
-}
-
static void er(int b, char *m, va_list l)
{
vfprintf(stderr, cast_const_char m, l);
@@ -111,7 +94,7 @@ void *mem_calloc_(size_t size, int mayfail)
if (!size)
return NULL;
retry:
- if (!(p = heap_calloc(size))) {
+ if (!(p = calloc(1, size))) {
if (out_of_memory_fl(0, !mayfail ? cast_uchar "calloc" : NULL, size, NULL, 0)) goto retry;
return NULL;
}
diff --git a/links.h b/links.h
@@ -215,11 +215,7 @@ void *xrealloc(void *, size_t);
#define ANSI_SET_BOLD "\033[1m"
#define ANSI_CLEAR_BOLD "\033[0m"
-#define alloc_overhead 0
-
void *do_not_optimize_here(void *p);
-void init_heap(void);
-void check_memory_leaks(void);
void error(char *, ...) PRINTF_FORMAT(1, 2);
void fatal_exit(char *, ...) PRINTF_FORMAT(1, 2) ATTR_NORETURN;
void debug_msg(char *, ...) PRINTF_FORMAT(1, 2);
diff --git a/main.c b/main.c
@@ -524,8 +524,6 @@ main(int argc, char *argv[])
g_argc = argc;
g_argv = (unsigned char **)argv;
- init_heap();
-
init_os();
get_path_to_exe();
@@ -533,6 +531,5 @@ main(int argc, char *argv[])
select_loop(init);
terminate_all_subsystems();
- check_memory_leaks();
return retval;
}