* \brief Implements Nibble Memory
*
* This is a simple and fairly wasteful little module for nibble memory
- * allocation. Evemtually we'll put in something better.
+ * allocation.
*
*/
#if HAVE_CONFIG_H
xfree(p->buf);
xfree(p);
if (log_level)
- yaz_log (log_level, "nmem free_block p=%p", p);
+ yaz_log(log_level, "nmem free_block p=%p", p);
}
/*
size_t get = NMEM_CHUNK;
if (log_level)
- yaz_log (log_level, "nmem get_block size=%ld", (long) size);
+ yaz_log(log_level, "nmem get_block size=%ld", (long) size);
-
if (get < size)
get = size;
- if(log_level)
- yaz_log (log_level, "nmem get_block alloc new block size=%ld",
- (long) get);
+ if (log_level)
+ yaz_log(log_level, "nmem get_block alloc new block size=%ld",
+ (long) get);
r = (struct nmem_block *) xmalloc(sizeof(*r));
r->buf = (char *)xmalloc(r->size = get);
{
struct nmem_block *t;
- yaz_log (log_level, "nmem_reset p=%p", n);
+ yaz_log(log_level, "nmem_reset p=%p", n);
if (!n)
return;
while (n->blocks)
if (!n)
{
- yaz_log (YLOG_FATAL, "calling nmem_malloc with an null pointer");
- abort ();
+ yaz_log(YLOG_FATAL, "calling nmem_malloc with an null pointer");
+ abort();
}
p = n->blocks;
if (!p || p->size < size + p->top)
xfree(n);
}
-void nmem_transfer (NMEM dst, NMEM src)
+void nmem_transfer(NMEM dst, NMEM src)
{
struct nmem_block *t;
while ((t = src->blocks))