https://github.com/halide/Halide
Raw File
Tip revision: b2e6d2aa1f205c0ed5f4e266252c633268de2805 authored by Steven Johnson on 25 June 2024, 00:19:26 UTC
Bump Halide version to 17.0.2 on release/17.x (#8315)
Tip revision: b2e6d2a
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