1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-29 20:35:13 +00:00

Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe

This commit is contained in:
Ali Mohammad Pur 2021-09-06 03:29:52 +04:30 committed by Andreas Kling
parent 3a9f00c59b
commit 97e97bccab
105 changed files with 629 additions and 290 deletions

View file

@ -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) {