Skip to content

Commit

Permalink
Removed extra heap allocation (Vec is already a heap allocation, so s…
Browse files Browse the repository at this point in the history
…hould be safe to pass to FFI without Box)
  • Loading branch information
gwihlidal committed Dec 17, 2018
1 parent 053001c commit 962ae59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ impl Default for AllocatorPoolCreateInfo {
pub struct DefragmentationContext {
pub(crate) internal: ffi::VmaDefragmentationContext,
pub(crate) stats: Box<ffi::VmaDefragmentationStats>,
pub(crate) changed: Box<Vec<ash::vk::Bool32>>,
pub(crate) changed: Vec<ash::vk::Bool32>,
}

/// Optional configuration parameters to be passed to `Allocator::defragment`
Expand Down Expand Up @@ -1549,7 +1549,7 @@ impl Allocator {
let mut context = DefragmentationContext {
internal: unsafe { mem::zeroed() },
stats: Box::new(unsafe { mem::zeroed() }),
changed: Box::new(vec![ash::vk::FALSE; allocations.len()]),
changed: vec![ash::vk::FALSE; allocations.len()],
};
let ffi_info = ffi::VmaDefragmentationInfo2 {
flags: 0, // Reserved for future use
Expand Down

0 comments on commit 962ae59

Please sign in to comment.