https://github.com/halide/Halide
Raw File
Tip revision: 70c0ed5a88fff8737ea2733f817c99d0807574a2 authored by ShihPo Hung on 19 September 2020, 08:29:43 UTC
Add initial support for RISCV RVV features
Tip revision: 70c0ed5
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