mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
fix for clean compilation
This commit is contained in:
parent
0803634cd1
commit
394fae7fc5
@ -7,6 +7,7 @@
|
|||||||
#ifndef _LVM_DBG_MALLOC_H
|
#ifndef _LVM_DBG_MALLOC_H
|
||||||
#define _LVM_DBG_MALLOC_H
|
#define _LVM_DBG_MALLOC_H
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef DEBUG_MEM
|
#ifdef DEBUG_MEM
|
||||||
@ -29,8 +30,3 @@ void bounds_check(void);
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* c-file-style: "linux"
|
|
||||||
* End:
|
|
||||||
*/
|
|
||||||
|
@ -123,17 +123,19 @@ void pool_free(struct pool *p, void *ptr)
|
|||||||
void *pool_begin_object(struct pool *p, size_t init_size)
|
void *pool_begin_object(struct pool *p, size_t init_size)
|
||||||
{
|
{
|
||||||
assert(!p->object);
|
assert(!p->object);
|
||||||
pool_alloc_aligned(p, hint);
|
pool_alloc_aligned(p, init_size, DEFAULT_ALIGNMENT);
|
||||||
p->object = 1;
|
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;
|
struct block *old = p->tail, *new;
|
||||||
|
|
||||||
assert(buffer == &old->data);
|
assert(buffer == &old->data);
|
||||||
|
|
||||||
if (!pool_alloc(p, old->size + n))
|
if (!pool_alloc(p, old->size + delta))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
new = p->tail;
|
new = p->tail;
|
||||||
|
@ -155,7 +155,7 @@ void *pool_begin_object(struct pool *p, size_t init_size)
|
|||||||
return c->begin;
|
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;
|
struct chunk *c = p->chunk, *nc;
|
||||||
|
|
||||||
@ -233,9 +233,3 @@ struct chunk *_new_chunk(struct pool *p, size_t s)
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* c-file-style: "linux"
|
|
||||||
* End:
|
|
||||||
* vim:ai cin ts=8
|
|
||||||
*/
|
|
||||||
|
@ -24,7 +24,7 @@ void pool_free(struct pool *p, void *ptr);
|
|||||||
|
|
||||||
/* object building routines */
|
/* object building routines */
|
||||||
void *pool_begin_object(struct pool *p, size_t init_size);
|
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_end_object(struct pool *p);
|
||||||
void pool_abandon_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
|
#endif
|
||||||
|
|
||||||
/*
|
|
||||||
* Local variables:
|
|
||||||
* c-file-style: "linux"
|
|
||||||
* End:
|
|
||||||
* vim:ai cin ts=4
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user