https://github.com/halide/Halide
Raw File
Tip revision: 7c700515f25fe985e2b16a3bb954250ed3d57979 authored by Andrew Adams on 19 December 2021, 19:40:49 UTC
clang-format
Tip revision: 7c70051
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