https://github.com/halide/Halide
Raw File
Tip revision: 02046aca422ce4277dc0f185e8e1ef2c7f3eb1c8 authored by Steven Johnson on 19 July 2021, 17:09:25 UTC
Merge branch 'master' into srj/hannk-mmap
Tip revision: 02046ac
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