https://github.com/halide/Halide
Raw File
Tip revision: d10c33c1e64e623e27d5e6b7b0da1ea9941ba164 authored by Derek Gerstmann on 20 June 2023, 18:22:15 UTC
trigger buildbots x2
Tip revision: d10c33c
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