mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
parent
b118ba72d0
commit
3cffc8c427
1 changed files with 1 additions and 4 deletions
|
@ -777,16 +777,13 @@ impl<K, V> RawTable<K, V> {
|
|||
|
||||
|
||||
// FORK NOTE: Uses alloc shim instead of Heap.alloc
|
||||
let buffer: *mut u8 = alloc(size, alignment);
|
||||
let buffer = alloc(size, alignment);
|
||||
|
||||
if buffer.is_null() {
|
||||
|
||||
return Err(FailedAllocationError { reason: "out of memory when allocating RawTable" });
|
||||
}
|
||||
|
||||
// FORK NOTE: poison the entire buffer rather than leaving it uninitialized.
|
||||
ptr::write_bytes(buffer, 0xe7, size);
|
||||
|
||||
let hashes = buffer.offset(hash_offset as isize) as *mut HashUint;
|
||||
|
||||
Ok(RawTable {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue