Skip to content

Commit

Permalink
fix: memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
liuq19 committed Aug 9, 2024
1 parent b794559 commit 5a1b533
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- run: cargo test --features arbitrary_precision
- run: cargo test --features sort_keys
- run: ./scripts/run_examples.sh
- run: ./scripts/sanitize.sh

test-stable-self:
name: Rust stable on self-hosted arm
Expand Down
3 changes: 2 additions & 1 deletion scripts/sanitize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ sanitize() {
TARGET=$2
TESTCASE=$3
echo "Running tests with $SAN on $TARGET"
# # use single thread to make error info more readable and accurate

# use single thread to make error info more readable and accurate
RUSTFLAGS="-Zsanitizer=$SAN" RUSTDOCFLAGS="-Zsanitizer=$SAN" cargo test --target $TARGET $3 -- --test-threads=1

RUSTFLAGS="-Zsanitizer=$SAN" RUSTDOCFLAGS="-Zsanitizer=$SAN" cargo test --doc --package sonic-rs --target $TARGET $3 -- --show-output --test-threads=1
Expand Down
1 change: 1 addition & 0 deletions src/value/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,7 @@ impl Value {
debug_assert!(self.is_container() || self.is_str());
if self.is_static() {
self.mark_shared(Shared::new_ptr());
self.mark_root();
}
self.shared()
}
Expand Down

0 comments on commit 5a1b533

Please sign in to comment.