https://github.com/halide/Halide
Raw File
Tip revision: 543eb4d8f3f261e01f83e517d162abe928d27914 authored by Marcos Slomp on 19 October 2023, 16:10:16 UTC
signed integer cast
Tip revision: 543eb4d
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