https://github.com/halide/Halide
Raw File
Tip revision: 59f949b5f8e2fda7061c357bc15994f8343d0a1f authored by Patricia Suriana on 27 February 2018, 18:19:43 UTC
Add script and parser for benchmarks
Tip revision: 59f949b
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