https://github.com/halide/Halide
Raw File
Tip revision: 0eec1e95a0f7bec4a5b9e77f561c6211e2c8f4ef authored by Steven Johnson on 09 September 2022, 18:33:50 UTC
Merge branch 'main' into gpu_canon_fix
Tip revision: 0eec1e9
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