Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion score/datarouter/test/ut/ut_logging/test_logparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ template <typename S, typename T>
std::string make_message(S typeIndex, const T& t)
{
static constexpr msgsize_t MaxMessageSize = 65500;
std::array<char, MaxMessageSize> buffer;
std::array<char, MaxMessageSize> buffer{};
Comment thread
arkjedrz marked this conversation as resolved.
using s = ::score::common::visitor::logging_serializer;
const auto indexSize = s::serialize(typeIndex, buffer.data(), buffer.size());
const auto size = indexSize + s::serialize(t, buffer.data() + indexSize, buffer.size() - indexSize);
Expand Down
10 changes: 10 additions & 0 deletions score/mw/log/rust/score_log_bridge/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,22 @@ config_setting(
],
)

config_setting(
name = "x86_64-qnx",
constraint_values = [
"@platforms//cpu:x86_64",
"@platforms//os:qnx",
],
)

cc_library(
name = "adapter",
srcs = ["src/adapter.cpp"],
# C++/Rust interface objects must share layout.
defines = select({
":x86_64-linux": ["x86_64_linux"],
":arm64-qnx": ["arm64_qnx"],
":x86_64-qnx": ["x86_64_qnx"],
"//conditions:default": [],
}),
visibility = ["//visibility:private"],
Expand All @@ -53,6 +62,7 @@ rust_library(
crate_features = select({
":x86_64-linux": ["x86_64_linux"],
":arm64-qnx": ["arm64_qnx"],
":x86_64-qnx": ["x86_64_qnx"],
"//conditions:default": [],
}),
edition = "2021",
Expand Down
2 changes: 1 addition & 1 deletion score/mw/log/rust/score_log_bridge/src/adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ using namespace score::mw::log::detail;
// Those parameters must be:
// - managed by build system (using defines and features)
// - cross-checked between `ffi.rs` and `adapter.cpp`
#if defined(x86_64_linux) || defined(arm64_qnx)
#if defined(x86_64_linux) || defined(arm64_qnx) || defined(x86_64_qnx)
// Expected size and alignment of `SlotHandle`.
static_assert(sizeof(SlotHandle) == 24);
static_assert(alignof(SlotHandle) == 8);
Expand Down
5 changes: 4 additions & 1 deletion score/mw/log/rust/score_log_bridge/src/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,15 @@ unsafe impl Sync for Recorder {}
/// Those parameters must be:
/// - managed by build system (using defines and features)
/// - cross-checked between `ffi.rs` and `adapter.cpp`
#[cfg(any(feature = "x86_64_linux", feature = "arm64_qnx"))]
#[cfg(any(feature = "x86_64_linux", feature = "arm64_qnx", feature = "x86_64_qnx"))]
#[repr(C, align(8))]
pub struct SlotHandleStorage {
_private: [u8; 24],
}

#[cfg(not(any(feature = "x86_64_linux", feature = "arm64_qnx", feature = "x86_64_qnx")))]
compile_error!("Unknown configuration, unable to check layout");

impl SlotHandleStorage {
/// Returns an unsafe mutable pointer to this object.
pub fn as_mut_ptr(&mut self) -> *mut SlotHandleStorage {
Expand Down
Loading