https://github.com/halide/Halide
Raw File
Tip revision: 9864bd4266cd0d65815a538bd9dfafa25c7a9b00 authored by Alex Reinking on 16 August 2024, 20:51:21 UTC
Fix bundling error on buildbots (#8392)
Tip revision: 9864bd4
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