https://github.com/halide/Halide
Raw File
Tip revision: 337140001a31240994a05b8008b6c0dc92485b3c authored by Steven Johnson on 23 August 2022, 23:21:24 UTC
Merge remote-tracking branch 'origin/rootjalex/fix-sat-overflow2' into srj/sat-fixes-exp-2
Tip revision: 3371400
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