https://github.com/halide/Halide
Raw File
Tip revision: 9711964cee91f9a5f9d45eef1f62bd8348ad86b9 authored by Steven Johnson on 27 March 2023, 23:10:24 UTC
Update DefaultCostModel.cpp
Tip revision: 9711964
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