https://github.com/halide/Halide
Raw File
Tip revision: 72224e1bd0bfe610b52aefefcf523fe1c029369b authored by Andrew Adams on 05 April 2021, 17:06:25 UTC
Add explicit cast to remove ambiguous operator== (Fixes #5329)
Tip revision: 72224e1
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