#ifndef __FFI_ALLOCATOR_H #define __FFI_ALLOCATOR_H #include #include #include #ifdef __cplusplus extern "C" #endif void Allocator_init(void); static inline char* GCx_strdup(const char* value) { #ifdef USE_LD_WRAP return(strdup(value)); #else #ifdef GC_STRDUP return(GC_STRDUP(value)); #else char* result; result = (char*) GC_MALLOC_ATOMIC(strlen(value) + 1); memcpy(result, value, strlen(value) + 1); return(result); #endif #endif } #endif /* ndef __FFI_ALLOCATOR_H */