https://github.com/halide/Halide
Raw File
Tip revision: 8c9c8d46d8993a0cedbbf3be74cccb79b62ffb98 authored by = on 26 March 2019, 22:34:40 UTC
Update onnx_converter
Tip revision: 8c9c8d4
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