vdl-alloc.h
author Hajime Tazaki <tazaki@nict.go.jp>
Wed, 13 Feb 2013 22:37:34 +0900
changeset 651 9d7e2cd9633b
parent 534 8baff8e0e08f
permissions -rw-r--r--
add a testcase to reproduce threaded dlclose crash (Bug 1513)

#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 */