1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

AK+Everywhere: Make FixedArray OOM-safe

FixedArray now doesn't expose any infallible constructors anymore.
Rather, it exposes fallible methods. Therefore, it can be used for
OOM-safe code.
This commit also converts the rest of the system to use the new API.
However, as an example, VMObject can't take advantage of this yet,
as we would have to endow VMObject with a fallible static
construction method, which would require a very fundamental change
to VMObject's whole inheritance hierarchy.
This commit is contained in:
creator1creeper1 2022-01-08 20:06:03 +01:00 committed by Linus Groh
parent a7b70c62d7
commit 3c05261611
5 changed files with 62 additions and 34 deletions

View file

@ -16,7 +16,7 @@ TEST_CASE(construct)
TEST_CASE(ints)
{
FixedArray<int> ints(3);
FixedArray<int> ints = FixedArray<int>::must_create_but_fixme_should_propagate_errors(3);
ints[0] = 0;
ints[1] = 1;
ints[2] = 2;