https://github.com/halide/Halide
Raw File
Tip revision: a21837ff1e085f22ef380c65847202d7917950e7 authored by Steven Johnson on 06 February 2021, 00:10:51 UTC
Merge branch 'master' into srj/msan-dtf
Tip revision: a21837f
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