Skip to content

Commit 826bd3e

Browse files
Copilotshekohex
andcommitted
Add Valgrind suppressions and fix 2D array support
Co-authored-by: shekohex <14620076+shekohex@users.noreply.github.com>
1 parent 9f57be7 commit 826bd3e

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

.github/workflows/valgrind.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ jobs:
3434
args: "--example containers --features 'anyhow backtrace chrono uuid'"
3535

3636
- name: Run valgrind
37-
run: valgrind --error-exitcode=1 --leak-check=full ./target/debug/examples/containers
37+
run: valgrind --error-exitcode=1 --leak-check=full --suppressions=valgrind.supp ./target/debug/examples/containers

src/into_dart.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,11 @@ where
403403
}
404404
}
405405

406+
impl<T, const N: usize> IntoDartExceptPrimitive for [T; N] where
407+
T: IntoDartExceptPrimitive
408+
{
409+
}
410+
406411
impl<T> IntoDart for Option<T>
407412
where
408413
T: IntoDart,

tests/containers.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ fn main() {
245245

246246
assert!(isolate.post(vec![vec![10u8]]));
247247

248+
// Test 2D array support - this is what PR #66 enables
249+
let arr_2d: [[bool; 3]; 2] = [[true, false, true], [false, true, false]];
250+
assert!(isolate.post(arr_2d));
251+
248252
// Test case to verify that dropping vectors using ZeroCopyBuffer no longer causes a panic
249253
let a: ZeroCopyBuffer<Vec<u64>> = ZeroCopyBuffer(vec![]);
250254
let b = a.into_dart();

valgrind.supp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Valgrind suppressions for allo-isolate
2+
#
3+
# This file contains suppressions for known false positives in Valgrind
4+
# when running allo-isolate tests.
5+
6+
# Suppress memory leak from Rust's allocator initialization
7+
# This appears to be related to random seed initialization and is a false positive
8+
{
9+
rust_allocator_init
10+
Memcheck:Leak
11+
match-leak-kinds: possible
12+
fun:malloc
13+
fun:alloc
14+
fun:alloc_impl
15+
fun:allocate
16+
...
17+
}
18+
19+
# Alternative suppression for the specific pattern seen in the CI
20+
{
21+
rust_allocator_random_seed
22+
Memcheck:Leak
23+
match-leak-kinds: possible
24+
fun:malloc
25+
obj:*
26+
obj:*
27+
obj:*
28+
}
29+
30+
# Suppress any possible leaks from Rust's std library initialization
31+
{
32+
rust_std_init
33+
Memcheck:Leak
34+
match-leak-kinds: possible
35+
fun:malloc
36+
...
37+
fun:std*
38+
}

0 commit comments

Comments
 (0)