mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe
This commit is contained in:
parent
3a9f00c59b
commit
97e97bccab
Notes:
sideshowbarker
2024-07-18 04:39:40 +09:00
Author: https://github.com/alimpfard
Commit: 97e97bccab
Pull-request: https://github.com/SerenityOS/serenity/pull/9832
Reviewed-by: https://github.com/IdanHo
105 changed files with 629 additions and 290 deletions
|
@ -169,7 +169,13 @@ static void allocate_tls()
|
|||
return;
|
||||
|
||||
auto page_aligned_size = align_up_to(s_total_tls_size, PAGE_SIZE);
|
||||
ByteBuffer initial_tls_data = ByteBuffer::create_zeroed(page_aligned_size);
|
||||
auto initial_tls_data_result = ByteBuffer::create_zeroed(page_aligned_size);
|
||||
if (!initial_tls_data_result.has_value()) {
|
||||
dbgln("Failed to allocate initial TLS data");
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
auto& initial_tls_data = initial_tls_data_result.value();
|
||||
|
||||
// Initialize TLS data
|
||||
for (const auto& entry : s_loaders) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue