/* * Copyright (c) Meta Platforms, Inc. and affiliates. * All rights reserved. * * This source code is licensed under both the BSD-style license (found in the * LICENSE file in the root directory of this source tree) and the GPLv2 (found * in the COPYING file in the root directory of this source tree). * You may select, at your option, one of the above-listed licenses. */ /* The implementation lives in rust/src/benchfn.rs, built into the Rust CLI * static archive. This translation unit stays in the original source lists so * build configuration keeps working while the implementation is in Rust. */ #include /* size_t, offsetof */ #include "benchfn.h" /* BMK_runTime_t and BMK_runOutcome_t are returned by value across the C/Rust * boundary, and BMK_benchParams_t is passed by value. The Rust #[repr(C)] * definitions mirror the offsets pinned here. */ typedef char BMK_staticAssert_runTimeSumOffset[ (offsetof(BMK_runTime_t, sumOfReturn) == sizeof(double)) ? 1 : -1]; typedef char BMK_staticAssert_outcomeResultOffset[ (offsetof(BMK_runOutcome_t, error_result_never_ever_use_directly) == sizeof(BMK_runTime_t)) ? 1 : -1]; typedef char BMK_staticAssert_outcomeTagOffset[ (offsetof(BMK_runOutcome_t, error_tag_never_ever_use_directly) == sizeof(BMK_runTime_t) + sizeof(size_t)) ? 1 : -1]; typedef char BMK_staticAssert_shellAlignment[ (sizeof(BMK_timedFnState_shell) == BMK_TIMEDFNSTATE_SIZE) ? 1 : -1];