From 394fae7fc50f36432ae6e2cb66bcfa30258415c5 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Wed, 12 Dec 2001 16:25:53 +0000 Subject: [PATCH] fix for clean compilation --- lib/mm/dbg_malloc.h | 6 +----- lib/mm/pool-debug.c | 8 +++++--- lib/mm/pool-fast.c | 8 +------- lib/mm/pool.h | 9 +-------- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/lib/mm/dbg_malloc.h b/lib/mm/dbg_malloc.h index 40aa188cf..3bf330476 100644 --- a/lib/mm/dbg_malloc.h +++ b/lib/mm/dbg_malloc.h @@ -7,6 +7,7 @@ #ifndef _LVM_DBG_MALLOC_H #define _LVM_DBG_MALLOC_H +#include #include #ifdef DEBUG_MEM @@ -29,8 +30,3 @@ void bounds_check(void); #endif -/* - * Local variables: - * c-file-style: "linux" - * End: - */ diff --git a/lib/mm/pool-debug.c b/lib/mm/pool-debug.c index f16c03e8e..35a1de375 100644 --- a/lib/mm/pool-debug.c +++ b/lib/mm/pool-debug.c @@ -123,17 +123,19 @@ void pool_free(struct pool *p, void *ptr) void *pool_begin_object(struct pool *p, size_t init_size) { assert(!p->object); - pool_alloc_aligned(p, hint); + pool_alloc_aligned(p, init_size, DEFAULT_ALIGNMENT); p->object = 1; + + return &p->tail->data; } -void *pool_grow_object(struct pool *p, unsigned char *buffer, size_t delta) +void *pool_grow_object(struct pool *p, void *buffer, size_t delta) { struct block *old = p->tail, *new; assert(buffer == &old->data); - if (!pool_alloc(p, old->size + n)) + if (!pool_alloc(p, old->size + delta)) return NULL; new = p->tail; diff --git a/lib/mm/pool-fast.c b/lib/mm/pool-fast.c index 4a314e4b4..f15e8fdd0 100644 --- a/lib/mm/pool-fast.c +++ b/lib/mm/pool-fast.c @@ -155,7 +155,7 @@ void *pool_begin_object(struct pool *p, size_t init_size) return c->begin; } -void *pool_grow_object(struct pool *p, unsigned char *buffer, size_t n) +void *pool_grow_object(struct pool *p, void *buffer, size_t n) { struct chunk *c = p->chunk, *nc; @@ -233,9 +233,3 @@ struct chunk *_new_chunk(struct pool *p, size_t s) return c; } -/* - * Local variables: - * c-file-style: "linux" - * End: - * vim:ai cin ts=8 - */ diff --git a/lib/mm/pool.h b/lib/mm/pool.h index 606390f89..2dda696f0 100644 --- a/lib/mm/pool.h +++ b/lib/mm/pool.h @@ -24,7 +24,7 @@ void pool_free(struct pool *p, void *ptr); /* object building routines */ void *pool_begin_object(struct pool *p, size_t init_size); -void *pool_grow_object(struct pool *p, unsigned char *buffer, size_t delta); +void *pool_grow_object(struct pool *p, void *buffer, size_t delta); void *pool_end_object(struct pool *p); void pool_abandon_object(struct pool *p); @@ -42,10 +42,3 @@ static inline void *pool_zalloc(struct pool *p, size_t s) { #endif -/* - * Local variables: - * c-file-style: "linux" - * End: - * vim:ai cin ts=4 - */ -