vdl-alloc.h
author Mathieu Lacage <mathieu.lacage@alcmeon.com>
Sat, 23 Feb 2013 20:59:51 +0100
changeset 656 e4817d48962f
parent 534 8baff8e0e08f
permissions -rw-r--r--
basic test for tls

#ifndef VDL_ALLOC_H
#define VDL_ALLOC_H

/**
 * A thin wrapper around the global variable which holds the 
 * allocator state.
 */

#include <unistd.h> // for size_t

#ifdef __cplusplus
extern "C" {
#endif

void vdl_alloc_initialize (void);
void vdl_alloc_destroy (void);

void *vdl_alloc_malloc (size_t size);
void vdl_alloc_free (void *buffer);
#define vdl_alloc_new(type) \
  (type *) vdl_alloc_malloc (sizeof (type))
#define vdl_alloc_delete(v) \
  vdl_alloc_free (v)

#ifdef __cplusplus
}
#endif

#endif /* VDL_ALLOC_H */