https://github.com/halide/Halide
Raw File
Tip revision: 3a92a3f95b86b7babeed7403a330334758e1d644 authored by Andrew Adams on 20 January 2022, 17:25:20 UTC
Delete test that relies on features not backported
Tip revision: 3a92a3f
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