https://github.com/halide/Halide
Raw File
Tip revision: 6135895aaa6bf337d6b79c2b21530387d368a4d0 authored by Volodymyr Kysenko on 17 January 2023, 22:04:00 UTC
Extend fp16 support for Xtensa
Tip revision: 6135895
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