Age | Commit message (Collapse) | Author |
|
This shrinks sizeof(Error) from 32 bytes to 24 bytes, which in turn will
shrink sizeof(ErrorOr<T>) by the same amount (in cases where sizeof(T)
is less than sizeof(Error)).
|
|
Well, *someone* has to add some more FIXMEs to keep FIXME Roulette
going. :^)
|
|
This is step 1 to removing `must_create()`.
|
|
|
|
This adds the the method DeprecatedString::find_last() as wrapper for
StringUtils::find_last for the StringView type.
|
|
|
|
|
|
Instead of avoiding overflow-checking builtins with AK_COMPILER_CLANG,
we can use the preprocessor's __has_builtin() mechanism to check if
they are available.
|
|
`OwnPtrWithCustomDeleter` was a decorator which provided the ability
to add a custom deleter to `OwnPtr` by wrapping and taking the deleter
as a run-time argument to the constructor. This solution means that no
additional space is needed for the `OwnPtr` because it doesn't need to
store a pointer to the deleter, but comes at the cost of having an
extra type that stores a pointer for every instance.
This logic is moved directly into `OwnPtr` by adding a template
argument that is defaulted to the default deleter for the type. This
means that the type itself stores the pointer to the deleter instead
of every instance and adds some type safety by encoding the deleter in
the type itself instead of taking a run-time argument.
|
|
|
|
|
|
1. Ensure long and long long are instantiated for to_int.
2. Ensure long and long long are not instantiated for to_uint.
|
|
This class is a smart pointer that let you provide a custom deleter to
free the pointer.
It is quite primitive compared to other smart pointers but can still be
useful when interacting with C types that provides a custom `free()`
function.
|
|
|
|
|
|
This was removed in a910961f37d1da9dafb6385e348266746354cf98 in favour
of the more general USING_AK_GLOBALLY #define, but Ladybird (and
probably other projects) depend on the smaller hammer to include STL
headers and keep the USING_AK_GLOBALLY behaviour, so put it back and
preserve its behaviour.
|
|
Note that this still keeps the old behaviour of putting things in std by
default on serenity so the tools can be happy, but if USING_AK_GLOBALLY
is unset, AK behaves like a good citizen and doesn't try to put things
in the ::std namespace.
std::nothrow_t and its friends get to stay because I'm being told that
compilers assume things about them and I can't yeet them into a
different namespace...for now.
|
|
|
|
This will allow the IPC system to use the exact required index type,
saving transmission space, once it can send variants.
|
|
A couple headers expected names to be in the global namespace, qualify
those names to make sure they're resolved even when the names are not
exported.
One header placed its functions in the global namespace, move those to
the AK namespace to make the concepts resolve.
|
|
I got the conditions wrong last time, oops :^)
|
|
This implements a shuffle function in AK/Random.h which works on any
container with size() and curly brace operators. It uses fisher-yates
shuffle.
|
|
|
|
This is the same as the libc function, just use the libc function.
|
|
|
|
|
|
Implement insertion sort in AK. The cutoff value 7 is a magic number
here, values [5, 15] should work well. Main idea of the cutoff is to
reduce recursion performed by quicksort to speed up sorting
of small partitions.
|
|
This was dearly missing and can be used in many existing templates.
|
|
This is used by the Jakt runtime.
|
|
This is required for the Jakt runtime.
|
|
|
|
The Jakt runtime requires this.
|
|
This makes it possible to emplace using a given function instead of
passing constructor arguments.
|
|
This keeps the FIXME, as well as the assertion.
|
|
|
|
Jakt implements this in a different way, but it's a noop for
StringViews anyway.
|
|
Note that Jakt only allows StringView creation from string literals, so
none of the invariants in the class are broken by this (if used only
from within Jakt).
|
|
`ErrorOr<T, E>::ResultType` can now refer to `T`.
|
|
This is used by the Jakt runtime.
|
|
This is needed by the Jakt runtime too.
|
|
The average user has no need for this, but the Jakt compiler uses this
to avoid going through the expensive ::visit() and ::get<>() APIs.
|
|
This is nice, and is also used by the Jakt runtime.
|
|
This allows the user to avoid constructing the default value if the
optional already contains a value.
This is used by the Jakt runtime.
|
|
This allows the user to transform the contents of the optional (if any
exists), without manually unwrapping and then rewrapping it.
This is needed by the Jakt runtime.
|
|
We were previously using Traits<V>, take that frrom the template
parameters instead.
This is needed by the Jakt runtime.
|
|
The old constraints were making clang mad, so express them in a less
complex way.
|
|
This is used in Jakt, and providing that value from Jakt's side is more
trouble than doing this.
Considering this class is bound to go away, a little
backwards-compatible API change is just fine.
|
|
`operator[]` returns a char, this is used in Jakt.
|
|
This is used in Jakt.
|
|
This API checks whether this path is a child of (or the same as) another
path.
|