https://github.com/halide/Halide
Raw File
Tip revision: be5e70aba145b6a736c803b2e62c9bf3988b5cbd authored by Steven Johnson on 26 August 2020, 01:32:08 UTC
wip
Tip revision: be5e70a
destructors.cpp
#include "HalideRuntime.h"

extern "C" {

ALWAYS_INLINE __attribute__((used)) 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