mempool-system.c revision 5517afec377fb7bf80e589b3efdd975f61dad5b3
/* Copyright (c) 2002-2014 Dovecot authors, see the included COPYING file */
/* @UNSAFE: whole file */
#include "lib.h"
#include "safe-memset.h"
#include "mempool.h"
#include <stdlib.h>
#ifndef HAVE_MALLOC_USABLE_SIZE
/* no extra includes needed */
#elif defined (HAVE_MALLOC_NP_H)
# include <malloc_np.h> /* FreeBSD */
#elif defined (HAVE_MALLOC_H)
# include <malloc.h> /* Linux */
#endif
#ifdef HAVE_GC_GC_H
# include <gc.h>
#endif
#define CLEAR_CHR 0xde
static struct pool_vfuncs static_system_pool_vfuncs = {
};
struct pool static_system_pool = {
.v = &static_system_pool_vfuncs,
.alloconly_pool = FALSE,
};
{
return "system";
}
{
}
{
}
{
void *mem;
#ifdef DEBUG
#endif
#ifndef USE_GC
#else
#endif
"): Out of memory", size);
}
#ifdef DEBUG
/* we rely on errno not changing. it shouldn't. */
#endif
return mem;
}
void *mem ATTR_UNUSED)
{
#ifdef DEBUG
#endif
#endif
#ifndef USE_GC
#endif
#ifdef DEBUG
/* we rely on errno not changing. it shouldn't. */
#endif
}
{
#if !defined(USE_GC) && defined(HAVE_MALLOC_USABLE_SIZE)
#endif
#ifndef USE_GC
#else
#endif
"): Out of memory", new_size);
}
/* clear new data */
}
return mem;
}
static void ATTR_NORETURN
{
i_panic("pool_system_clear() must not be called");
}
{
return 0;
}