mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-12 09:56:45 +02:00
LibJS+LibWeb: Allow instantiating DataBlock with an external buffer
This requires the minimal API exposed by ByteBuffer, allowing external users to implement them as needed instead of being forced to use a ByteBuffer.
This commit is contained in:
committed by
Ali Mohammad Pur
parent
0a7bef349d
commit
0bb987e809
Notes:
github-actions[bot]
2026-05-10 14:43:40 +00:00
Author: https://github.com/alimpfard Commit: https://github.com/LadybirdBrowser/ladybird/commit/0bb987e809f Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8866 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/R-Goc Reviewed-by: https://github.com/gmta Reviewed-by: https://github.com/trflynn89
@@ -893,7 +893,7 @@ inline Value fast_typed_array_get_element(TypedArrayBase& typed_array, u32 index
|
||||
}
|
||||
|
||||
auto const& array_buffer = *typed_array.viewed_array_buffer();
|
||||
auto const* slot = reinterpret_cast<T const*>(array_buffer.buffer().offset_pointer(offset_into_array_buffer.value()));
|
||||
auto const* slot = reinterpret_cast<T const*>(array_buffer.span().offset_pointer(offset_into_array_buffer.value()));
|
||||
return Value { *slot };
|
||||
}
|
||||
|
||||
@@ -911,7 +911,7 @@ inline void fast_typed_array_set_element(TypedArrayBase& typed_array, u32 index,
|
||||
}
|
||||
|
||||
auto& array_buffer = *typed_array.viewed_array_buffer();
|
||||
auto* slot = reinterpret_cast<T*>(array_buffer.buffer().offset_pointer(offset_into_array_buffer.value()));
|
||||
auto* slot = reinterpret_cast<T*>(array_buffer.span().offset_pointer(offset_into_array_buffer.value()));
|
||||
*slot = value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user