amethyst / amethyst/rendy

alloc debug overflow on size 0

Open
#159 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
812
Forks
94
PR merge metrics
No merged PRs in 30d

Description

if the size is 0, this will abort on a sub overflow in debug mode.

```rust
fn alloc(
&mut self,
device: &B::Device,
size: u64,
align: u64,
) -> Result<(DynamicBlock, u64), gfx_hal::device::AllocationError> {
debug_assert!(size <= self.max_allocation());
debug_assert!(align.is_power_of_two());
let aligned_size = ((size - 1) | (align - 1) | (self.block_size_granularity - 1)) + 1;
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.