From 6eff5e7b0926a50f0c5bade0aeeb5d6cc01ece1e Mon Sep 17 00:00:00 2001 From: Arne Goedeke <el@laramies.com> Date: Wed, 9 Oct 2013 09:40:29 +0200 Subject: [PATCH] block_allocator: cleaned up some old includes --- src/callback.c | 3 +-- src/constants.c | 22 +++++++++------------- src/constants.h | 1 - src/modules/Parser/c.c | 1 - src/modules/Parser/html.c | 4 +--- src/modules/Parser/pike.c | 1 - src/modules/Parser/rcs.c | 1 - src/stralloc.c | 1 - 8 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/callback.c b/src/callback.c index de977cd69a..080d0c9cf1 100644 --- a/src/callback.c +++ b/src/callback.c @@ -8,7 +8,7 @@ #include "pike_macros.h" #include "callback.h" #include "pike_error.h" -#include "block_alloc.h" +#include "block_allocator.h" struct callback_list fork_child_callback; @@ -36,7 +36,6 @@ struct callback #endif #endif -#include "block_allocator.h" static struct block_allocator callback_allocator = BA_INIT(sizeof(struct callback), CALLBACK_CHUNK); diff --git a/src/constants.c b/src/constants.c index 7d89182fc9..7326db7af9 100644 --- a/src/constants.c +++ b/src/constants.c @@ -16,8 +16,7 @@ #include "pike_error.h" #include "pike_security.h" #include "gc.h" - -#include "block_alloc.h" +#include "block_allocator.h" struct mapping *builtin_constants = 0; @@ -68,23 +67,20 @@ PMOD_EXPORT void add_global_program(const char *name, struct program *p) low_add_constant(name, p?&s:NULL); } -#undef EXIT_BLOCK -#define EXIT_BLOCK(X) do { \ - DO_IF_DEBUG (DOUBLEUNLINK (first_callable, X)); \ - free_type(X->type); \ - free_string(X->name); \ - X->name=0; \ - EXIT_PIKE_MEMOBJ(X); \ -}while(0) - -#include "block_allocator.h" static struct block_allocator callable_allocator = BA_INIT_PAGES(sizeof(struct callable), 2); void really_free_callable(struct callable * c) { - EXIT_BLOCK(c); +#ifdef PIKE_DEBUG + DOUBLEUNLINK (first_callable, c); +#endif + free_type(c->type); + free_string(c->name); + c->name=0; + EXIT_PIKE_MEMOBJ(c); ba_free(&callable_allocator, c); } + void count_memory_in_callables(size_t * num, size_t * size) { ba_count_all(&callable_allocator, num, size); } diff --git a/src/constants.h b/src/constants.h index d9ffdcdbad..4934f3d988 100644 --- a/src/constants.h +++ b/src/constants.h @@ -10,7 +10,6 @@ #include "svalue.h" #include "hashtable.h" #include "las.h" /* For OPT_SIDE_EFFECT etc. */ -#include "block_alloc_h.h" typedef int (*docode_fun)(node *n); typedef node *(*optimize_fun)(node *n); diff --git a/src/modules/Parser/c.c b/src/modules/Parser/c.c index 39e4c8f4f5..3f2b305bda 100644 --- a/src/modules/Parser/c.c +++ b/src/modules/Parser/c.c @@ -15,7 +15,6 @@ #include "mapping.h" #include "stralloc.h" #include "program_id.h" -#include "block_alloc.h" #include <ctype.h> #include "parser.h" diff --git a/src/modules/Parser/html.c b/src/modules/Parser/html.c index a0d2544649..532a0859b5 100644 --- a/src/modules/Parser/html.c +++ b/src/modules/Parser/html.c @@ -21,7 +21,7 @@ #include "mapping.h" #include "stralloc.h" #include "program_id.h" -#include "block_alloc.h" +#include "block_allocator.h" #include <ctype.h> #include "parser.h" @@ -88,8 +88,6 @@ struct piece struct piece *next; }; -#include "block_allocator.h" - static struct block_allocator piece_allocator = BA_INIT_PAGES(sizeof(struct piece), 2); diff --git a/src/modules/Parser/pike.c b/src/modules/Parser/pike.c index 96a6412e7a..b988849c2f 100644 --- a/src/modules/Parser/pike.c +++ b/src/modules/Parser/pike.c @@ -19,7 +19,6 @@ #include "mapping.h" #include "stralloc.h" #include "program_id.h" -#include "block_alloc.h" #include <ctype.h> #include "parser.h" diff --git a/src/modules/Parser/rcs.c b/src/modules/Parser/rcs.c index 0a2ba33f3b..3d9441699e 100644 --- a/src/modules/Parser/rcs.c +++ b/src/modules/Parser/rcs.c @@ -14,7 +14,6 @@ #include "mapping.h" #include "stralloc.h" #include "program_id.h" -#include "block_alloc.h" #include <ctype.h> #include "parser.h" diff --git a/src/stralloc.c b/src/stralloc.c index 5d97026659..40d8de117b 100644 --- a/src/stralloc.c +++ b/src/stralloc.c @@ -15,7 +15,6 @@ #include "stuff.h" #include "bignum.h" #include "interpret.h" -#include "block_alloc.h" #include "operators.h" #include "pike_float.h" #include "block_allocator.h" -- GitLab