https://github.com/halide/Halide
Raw File
Tip revision: cd1e94d505f0d238b37f0012d53cc0e9bd2b44c9 authored by Steven Johnson on 07 February 2020, 22:56:56 UTC
Forbid debug_to_file() on vectorized Funcs (Issue #4596)
Tip revision: cd1e94d
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