https://github.com/halide/Halide
Raw File
Tip revision: cf8c8f22eb507aedeba5a44f8ee20bc63757dc57 authored by Steven Johnson on 07 December 2021, 18:14:38 UTC
Bump versions to 13.0.2
Tip revision: cf8c8f2
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