/* Copyright (c) 2017-2018 Dovecot authors, see the included COPYING file */
/* @UNSAFE: whole file */
#include "lib.h"
#include "safe-memset.h"
#include "mempool.h"
#include "llist.h"
struct allocfree_pool {
int refcount;
#ifdef DEBUG
char *name;
#endif
bool clean_frees;
};
struct pool_block {
unsigned char *block;
};
};
.v = &static_allocfree_pool_vfuncs,
.alloconly_pool = FALSE,
};
{
#ifdef DEBUG
#endif
}
{
return pool;
}
{
if (apool->clean_frees)
#ifdef DEBUG
#endif
}
{
#ifdef DEBUG
#else
return "alloc";
#endif
}
{
}
{
/* erase the pointer before freeing anything, as the pointer may
exist inside the pool's memory area */
return;
}
{
}
static struct pool_block *
{
/* make sure the block we are dealing with is correct */
return block;
}
{
SIZEOF_POOLBLOCK + size);
}
{
return;
if (apool->clean_frees)
}
{
unsigned char *new_mem;
/* zero out new memory */
}
{
}
}
{
return 0;
}
{
return apool->total_alloc_used;
}
{
return apool->total_alloc_used +
}