Replace most uses of pointer::offset
with add
and sub
This commit is contained in:
parent
6c943bad02
commit
e4720e1cf2
22 changed files with 57 additions and 57 deletions
|
@ -156,7 +156,7 @@ mod platform {
|
|||
struct Header(*mut u8);
|
||||
const HEAP_ZERO_MEMORY: DWORD = 0x00000008;
|
||||
unsafe fn get_header<'a>(ptr: *mut u8) -> &'a mut Header {
|
||||
&mut *(ptr as *mut Header).offset(-1)
|
||||
&mut *(ptr as *mut Header).sub(1)
|
||||
}
|
||||
unsafe fn align_ptr(ptr: *mut u8, align: usize) -> *mut u8 {
|
||||
let aligned = ptr.add(align - (ptr as usize & (align - 1)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue