kore

An easy to use, scalable and secure web application framework for writing web APIs in C.
Commits | Files | Refs | README | LICENSE | git clone https://git.kore.io/kore.git

commit 20f02ced2309775c0e9247e482bc169c379d1984
parent 712461b081c90b8d73b7a2ecafbd063e5e8806cc
Author: Joris Vink <joris@coders.se>
Date:   Thu, 25 Jul 2013 23:41:00 +0200

remove meminuse and list of allocated memory blocks, we don't need it.

Diffstat:
includes/kore.h | 1-
src/mem.c | 12------------
2 files changed, 0 insertions(+), 13 deletions(-)

diff --git a/includes/kore.h b/includes/kore.h @@ -212,7 +212,6 @@ extern char *config_file; extern char *kore_ssl_cipher_list; extern u_int64_t spdy_idle_time; -extern u_int32_t meminuse; extern u_int16_t cpu_count; extern u_int8_t worker_count; extern u_int32_t worker_max_connections; diff --git a/src/mem.c b/src/mem.c @@ -28,17 +28,11 @@ struct meminfo { u_int16_t magic; - TAILQ_ENTRY(meminfo) list; } __attribute__((__packed__)); -u_int32_t meminuse; -TAILQ_HEAD(, meminfo) memused; - void kore_mem_init(void) { - meminuse = 0; - TAILQ_INIT(&memused); } void * @@ -60,9 +54,6 @@ kore_malloc(size_t len) mem = KORE_MEMINFO(addr); mem->magic = KORE_MEM_MAGIC; - TAILQ_INSERT_TAIL(&memused, mem, list); - - meminuse += len; return (addr); } @@ -104,9 +95,6 @@ kore_mem_free(void *ptr) if (mem->magic != KORE_MEM_MAGIC) fatal("kore_mem_free(): magic boundary not found"); - meminuse -= KORE_MEMSIZE(ptr); - TAILQ_REMOVE(&memused, mem, list); - addr = (u_int8_t *)ptr - sizeof(u_int32_t); free(addr); }