https://github.com/halide/Halide
Raw File
Tip revision: 6f2eb3532cd10174d4b78d7e3541c79d0838d16f authored by Steven Johnson on 25 October 2022, 17:29:07 UTC
Require Python 3.8+ in CMake build (#7117)
Tip revision: 6f2eb35
destructors.cpp
#include "HalideRuntime.h"
#include "printer.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 = nullptr;
    // Call the function
    if (o && should_call) {
        fn(user_context, o);
    }
}
}
back to top