https://github.com/halide/Halide
Raw File
Tip revision: 5dabcaa9effca1067f907f6c8ea212f3d2b1d99a authored by Alex Reinking on 20 May 2021, 22:51:57 UTC
Set version to 12.0.1
Tip revision: 5dabcaa
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