https://github.com/halide/Halide
Raw File
Tip revision: 8c505640d49d8f449a56a90e6599229401bd5462 authored by Steven Johnson on 14 February 2024, 17:09:50 UTC
Merge remote-tracking branch 'origin/abadams/strip_asserts_last' into srj/test8094
Tip revision: 8c50564
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