bevy/crates
Boxy a1a07945d6 fix some memory leaks detected by miri (#4959)
The first leak:
```rust
    #[test]
    fn blob_vec_drop_empty_capacity() {
        let item_layout = Layout:🆕:<Foo>();
        let drop = drop_ptr::<Foo>;
        let _ = unsafe { BlobVec::new(item_layout, Some(drop), 0) };
    }
```
this is because we allocate the swap scratch in blobvec regardless of what the capacity is, but we only deallocate if capacity is > 0

The second leak:
```rust
    #[test]
    fn panic_while_overwriting_component() {
        let helper = DropTestHelper::new();

        let res = panic::catch_unwind(|| {
            let mut world = World::new();
            world
                .spawn()
                .insert(helper.make_component(true, 0))
                .insert(helper.make_component(false, 1));

            println!("Done inserting! Dropping world...");
        });

        let drop_log = helper.finish(res);

        assert_eq!(
            &*drop_log,
            [
                DropLogItem::Create(0),
                DropLogItem::Create(1),
                DropLogItem::Drop(0),
            ]
        );
    }
```
this is caused by us not running the drop impl on the to-be-inserted component if the drop impl of the overwritten component panics

---

managed to figure out where the leaks were by using this 10/10 command
```
cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation" xargs -n1 cargo miri test --lib -- --exact
```
which runs every test one by one rather than all at once which let miri actually tell me which test had the leak 🙃
2022-07-01 21:54:28 +00:00
..
bevy_animation Add helper methods for rotating Transforms (#5151) 2022-07-01 03:58:54 +00:00
bevy_app Add global init and get accessors for all newtyped TaskPools (#2250) 2022-06-09 02:43:24 +00:00
bevy_asset Derive default for enums where possible (#5158) 2022-07-01 03:42:15 +00:00
bevy_audio Clippy improvements (#4665) 2022-05-31 01:38:07 +00:00
bevy_core Add global init and get accessors for all newtyped TaskPools (#2250) 2022-06-09 02:43:24 +00:00
bevy_core_pipeline Derive default for enums where possible (#5158) 2022-07-01 03:42:15 +00:00
bevy_derive android - fix issues other than the rendering (#5130) 2022-06-30 19:42:45 +00:00
bevy_diagnostic Cleanups in diagnostics (#3871) 2022-06-20 17:02:25 +00:00
bevy_dylib Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_dynamic_plugin Bump Bevy to 0.8.0-dev (#4505) 2022-04-17 23:04:52 +00:00
bevy_ecs fix some memory leaks detected by miri (#4959) 2022-07-01 21:54:28 +00:00
bevy_ecs_compile_fail_tests Fix rust 1.62 changes (#5154) 2022-06-30 19:24:28 +00:00
bevy_encase_derive Migrate to encase from crevice (#4339) 2022-05-18 21:09:21 +00:00
bevy_gilrs Update gilrs to v0.9 (#4848) 2022-05-30 17:26:23 +00:00
bevy_gltf fix new clippy lints (#5160) 2022-07-01 13:41:23 +00:00
bevy_hierarchy add a SceneBundle to spawn a scene (#2424) 2022-06-09 20:34:09 +00:00
bevy_input Update MouseMotion and CursorMoved docs (#5090) 2022-06-26 13:40:43 +00:00
bevy_internal enable optional dependencies to stay optional (#5023) 2022-06-20 10:32:43 +00:00
bevy_log bevy_log: upgrade to tracing-tracy 0.10.0 (#4991) 2022-06-13 22:40:29 +00:00
bevy_macro_utils bevy_reflect_derive: Tidying up the code (#4712) 2022-05-12 19:43:23 +00:00
bevy_math Document bevy_math (#4591) 2022-04-26 18:23:29 +00:00
bevy_mikktspace Generate vertex tangents using mikktspace (#3872) 2022-05-31 22:53:54 +00:00
bevy_pbr Removed world cell from places where split multable access is not needed (#5167) 2022-07-01 17:03:32 +00:00
bevy_ptr Clippy improvements (#4665) 2022-05-31 01:38:07 +00:00
bevy_reflect Derive default for enums where possible (#5158) 2022-07-01 03:42:15 +00:00
bevy_render fix new clippy lints (#5160) 2022-07-01 13:41:23 +00:00
bevy_scene Fix ron deprecation (#5021) 2022-06-15 19:18:53 +00:00
bevy_sprite Removed world cell from places where split multable access is not needed (#5167) 2022-07-01 17:03:32 +00:00
bevy_tasks Miri can set thread names now (#5108) 2022-06-26 21:28:00 +00:00
bevy_text Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
bevy_time Split time functionality into bevy_time (#4187) 2022-05-26 00:27:18 +00:00
bevy_transform Add helper methods for rotating Transforms (#5151) 2022-07-01 03:58:54 +00:00
bevy_ui Removed world cell from places where split multable access is not needed (#5167) 2022-07-01 17:03:32 +00:00
bevy_utils update hashbrown to 0.12 (#5035) 2022-06-17 22:34:58 +00:00
bevy_window fix new clippy lints (#5160) 2022-07-01 13:41:23 +00:00
bevy_winit android - fix issues other than the rendering (#5130) 2022-06-30 19:42:45 +00:00