https://github.com/halide/Halide
Raw File
Tip revision: 337ee9692cfad667ce58a4712a61a199332bda7e authored by Steven Johnson on 29 November 2017, 22:51:00 UTC
Build fixes for CMake atc
Tip revision: 337ee96
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