onnxruntime/onnxruntime/core/framework/onnx_object.cc
Ryan Hill 773114a4f1
More C header naming changes (#202)
* More Ort prefix changes for consistency

* Fix C# methods

* More C# fixes
2018-12-18 11:39:46 -08:00

21 lines
520 B
C++

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#include "core/session/onnxruntime_c_api.h"
#include <atomic>
ORT_API(uint32_t, OrtAddRefToObject, void* ptr) {
return (*static_cast<OrtObject**>(ptr))->AddRef(ptr);
}
ORT_API(uint32_t, OrtReleaseObject, void* ptr) {
if (ptr == nullptr) return 0;
return (*static_cast<OrtObject**>(ptr))->Release(ptr);
}
namespace {
struct ObjectImpl {
const OrtObject* const cls;
std::atomic_int ref_count;
};
} // namespace