You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iggy.apache.org by gk...@apache.org on 2026/03/24 13:33:24 UTC
(iggy) 05/05: fix ci
This is an automated email from the ASF dual-hosted git repository.
gkoszyk pushed a commit to branch partition_redesign
in repository https://gitbox.apache.org/repos/asf/iggy.git
commit af85f513273a4b4893bebd2e3e7aab52913f80ff
Author: numinex <g....@gmail.com>
AuthorDate: Fri Mar 20 09:27:02 2026 +0100
fix ci
---
Cargo.toml | 2 +-
DEPENDENCIES.md | 1 +
core/buf/Cargo.toml | 17 +++++++++++++++++
core/buf/src/lib.rs | 33 +++++++++++++++++++++++++++------
4 files changed, 46 insertions(+), 7 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index 067dd90d4..5cf08a4fb 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,7 +25,7 @@ members = [
"core/bench/dashboard/shared",
"core/bench/report",
"core/bench/runner",
- "core/binary_protocol",
+ "core/binary_protocol",
"core/buf",
"core/cli",
"core/clock",
diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md
index e89e01db6..318beb266 100644
--- a/DEPENDENCIES.md
+++ b/DEPENDENCIES.md
@@ -127,6 +127,7 @@ brotli: 8.0.2, "BSD-3-Clause AND MIT",
brotli-decompressor: 5.0.0, "BSD-3-Clause OR MIT",
bson: 2.15.0, "MIT",
bstr: 1.12.1, "Apache-2.0 OR MIT",
+buf: 0.1.0, "N/A",
built: 0.8.0, "MIT",
bumpalo: 3.20.2, "Apache-2.0 OR MIT",
byte-unit: 5.2.0, "MIT",
diff --git a/core/buf/Cargo.toml b/core/buf/Cargo.toml
index 8a5d193a9..b14799278 100644
--- a/core/buf/Cargo.toml
+++ b/core/buf/Cargo.toml
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
[package]
name = "buf"
version = "0.1.0"
diff --git a/core/buf/src/lib.rs b/core/buf/src/lib.rs
index 5d4075d74..307fc3034 100644
--- a/core/buf/src/lib.rs
+++ b/core/buf/src/lib.rs
@@ -1,3 +1,20 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
use std::mem::ManuallyDrop;
use std::ptr::NonNull;
use std::slice;
@@ -44,7 +61,7 @@ impl<const ALIGN: usize> Owned<ALIGN> {
// SAFETY: both pointers are constructed from the same `Inner` allocation, the split_at bounds are validated.
// The control block captures original `Inner` metadata to allow reconstructing the original frame for merging/dropping.
- // The ptr provenence rules are maintained by the use of `NonNull` apis.
+ // The ptr provenance rules are maintained by the use of `NonNull` apis.
let base: NonNull<u8> = unsafe { NonNull::new_unchecked(ptr) };
let tail = unsafe { NonNull::new_unchecked(ptr.add(split_at)) };
let ctrlb = ControlBlock::new(base, len, capacity);
@@ -114,10 +131,10 @@ impl<const ALIGN: usize> TwoHalves<ALIGN> {
return Err(self);
}
- // Transfer ownership to prevent double-free
+ // Transfer ownership to prevent double-free.
+ // SAFETY: We read the inner tuple out of ManuallyDrop, which won't run TwoHalves::drop.
let this = ManuallyDrop::new(self);
- let head = this.inner.0;
- let tail = this.inner.1;
+ let (head, tail) = unsafe { std::ptr::read(&this.inner) };
let split_at = head.len;
// SAFETY: `tail.ctrlb` is unique at this point,
@@ -216,7 +233,6 @@ impl ControlBlock {
}
}
-#[derive(Copy)]
struct Extent {
ptr: NonNull<u8>,
len: usize,
@@ -262,7 +278,12 @@ impl Clone for Extent {
.ref_count
.fetch_add(1, Ordering::Relaxed);
}
- *self
+ Self {
+ ptr: self.ptr,
+ len: self.len,
+ ctrlb: self.ctrlb,
+ _pad: 0,
+ }
}
}