https://github.com/halide/Halide
Raw File
Tip revision: a57aecbbaeb36241b298afb4e479b44b4a589b7d authored by Steven Johnson on 21 October 2021, 20:30:53 UTC
Merge branch 'master' into srj/visit-warnings
Tip revision: a57aecb
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