https://github.com/halide/Halide
Raw File
Tip revision: fff6d4b5f33f584953624afcd96f01cdcccc5ba9 authored by Steven Johnson on 29 August 2019, 18:32:23 UTC
Update WebAssembly support code to properly handle float16 and bfloat16
Tip revision: fff6d4b
destructors.cpp
#include "HalideRuntime.h"

#define INLINE inline __attribute__((weak)) __attribute__((always_inline)) __attribute__((used))

extern "C" {

INLINE void call_destructor(void *user_context, void (*fn)(void *user_context, void *object), void **object, bool should_call) {
    void *o = *object;
    *object = NULL;
    // Call the function
    if (o && should_call) {
        fn(user_context, o);
    }
}

}
back to top