Skip to content

Commit

Permalink
Aktualisieren von alloc.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
filmor authored May 6, 2024
1 parent 7d799bf commit 792084e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions rustler/src/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ unsafe impl GlobalAlloc for EnifAllocator {
if layout.align() > MAX_ALIGN {
// overallocate and store the original pointer in memory immediately before the aligned
// section
let padded = layout.pad_to_align();
let total_size = SIZEOF_USIZE + padded.size();
let total_size = SIZEOF_USIZE + layout.size() + layout.align() - 1;
let ptr = rustler_sys::enif_alloc(total_size) as *mut u8;

let ptr1 = ptr.wrapping_add(SIZEOF_USIZE);
Expand Down

0 comments on commit 792084e

Please sign in to comment.