https://github.com/halide/Halide
Raw File
Tip revision: d7e1a447c7739ca501fc8c716255dfb67c167c81 authored by Steven Johnson on 27 June 2023, 17:35:38 UTC
Merge branch 'main' into srj/pip-cron
Tip revision: d7e1a44
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