Skip to content

Commit

Permalink
Merge pull request #55 from SlimeYummy/issue/sampleing-drop
Browse files Browse the repository at this point in the history
Add miss SamplingContext drop
  • Loading branch information
SlimeYummy authored Mar 25, 2024
2 parents c462fbe + 9ad19f0 commit 8d46b8c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "MPL-2.0"
homepage = "https://github.com/SlimeYummy/ozz-animation-rs"
repository = "https://github.com/SlimeYummy/ozz-animation-rs"
keywords = ["animation", "skeletal-animation", "fixed-point", "deterministic", "ozz-animation"]
categories = ["game-development", "rendering::data-formats", "api-bindings"]
categories = ["game-development", "rendering::data-formats", "api-bindings", "wasm"]
exclude = ["/.circleci", "/.github", "/demo", "/expected", "/output", "/resource"]
resolver = "2"

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Release Doc](https://docs.rs/ozz-animation-rs/badge.svg)](https://docs.rs/ozz-animation-rs)
[![Crate](https://img.shields.io/crates/v/ozz-animation-rs.svg)](https://crates.io/crates/ozz-animation-rs)
![github actions](https://github.com/FenQiDian/ozz-animation-rs/actions/workflows/main.yml/badge.svg)
![github actions](https://github.com/SlimeYummy/ozz-animation-rs/actions/workflows/main.yml/badge.svg)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/SlimeYummy/ozz-animation-rs/tree/master.svg?style=shield)](https://dl.circleci.com/status-badge/redirect/gh/SlimeYummy/ozz-animation-rs/tree/master)

# Ozz-animation-rs
Expand Down Expand Up @@ -32,11 +32,11 @@ Ozz-animation offline features are not supported, and no plans to support. Pleas

### Examples

A simple demo is in [./demo](https://github.com/FenQiDian/ozz-animation-rs/tree/master/demo) folder. Enter the folder and execute `cargo run`.
A simple demo is in [./demo](https://github.com/SlimeYummy/ozz-animation-rs/tree/master/demo) folder. Enter the folder and execute `cargo run`.

![demo](https://raw.githubusercontent.com/SlimeYummy/ozz-animation-rs/master/demo/demo.jpg)

The test cases under [./tests](https://github.com/FenQiDian/ozz-animation-rs/tree/master/tests) can be viewed as examples.
The test cases under [./tests](https://github.com/SlimeYummy/ozz-animation-rs/tree/master/tests) can be viewed as examples.

Ozz-animation-rs keeps the same API styles with original ozz-animation library. Therefore, you can also refer to the ozz-animation [examples](https://github.com/guillaumeblanc/ozz-animation/tree/master/samples).

Expand Down Expand Up @@ -86,7 +86,7 @@ In theory, ozz-animation-rs supports all platforms supported by rust. But I only
- Windows/Ubuntu/Mac x64 (Github actions)
- X64/Arm64 docker ([CircleCI](https://dl.circleci.com/status-badge/redirect/gh/SlimeYummy/ozz-animation-rs/tree/master))

Maybe you can run cross-platform deterministic test cases under [./tests](https://github.com/FenQiDian/ozz-animation-rs/tree/master/tests) on your target platform.
Maybe you can run cross-platform deterministic test cases under [./tests](https://github.com/SlimeYummy/ozz-animation-rs/tree/master/tests) on your target platform.

### Why not fixed-point?

Expand Down
9 changes: 9 additions & 0 deletions src/sampling_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,15 @@ impl PartialEq for SamplingContext {
}
}

impl Drop for SamplingContext {
fn drop(&mut self) {
unsafe {
let layout = Layout::from_size_align_unchecked(self.size(), mem::size_of::<f32x4>());
alloc::dealloc(self.0 as *mut u8, layout);
}
}
}

impl SamplingContext {
#[inline(always)]
fn inner(&self) -> &SamplingContextInner {
Expand Down

0 comments on commit 8d46b8c

Please sign in to comment.