https://github.com/halide/Halide
Raw File
Tip revision: 07821c6fd2306aa48338915812c74a5df8074dca authored by Ahmed Taei on 17 January 2019, 00:27:41 UTC
Print llvm -time-passes statstics when JIT or AOT compile an LLVM module
Tip revision: 07821c6
destructors.cpp
#include "HalideRuntime.h"

#define INLINE inline __attribute__((weak)) __attribute__((always_inline)) __attribute__((used))

extern "C" {

INLINE void call_destructor(void *user_context, void (*fn)(void *user_context, void *object), void **object, bool should_call) {
    void *o = *object;
    *object = NULL;
    // Call the function
    if (o && should_call) {
        fn(user_context, o);
    }
}

}
back to top