serenity/AK
kleines Filmröllchen 2f50d8f4d3 AK+LibC+LibPthread: Introduce NoAllocationGuard
NoAllocationGuard is an RAII stack guard that prevents allocations
while it exists. This is done through a thread-local global flag which
causes malloc to crash on a VERIFY if it is false. The guard allows for
recursion.

The intended use case for this class is in real-time audio code. In such
code, allocations are really bad, and this is an easy way of dynamically
enforcing the no-allocations rule while giving the user good feedback if
it is violated. Before real-time audio code is executed, e.g. in LibDSP,
a NoAllocationGuard is instantiated. This is not done with this commit,
as currently some code in LibDSP may still incorrectly allocate in real-
time situations.

Other use cases for the Kernel have also been added, so this commit
builds on the previous to add the support both in Userland and in the
Kernel.
2022-01-11 00:08:58 +01:00
..
.clang-tidy Meta: Add basic clang-tidy configuration 2021-11-14 22:52:35 +01:00
AllOf.h
AnyOf.h
Array.h AK: Simplify Array::back() by checking for Size > 0 2021-12-11 23:15:24 +01:00
Assertions.h AK: Suppress false-positive clang-tidy warning in Assertions.h 2021-11-14 22:52:35 +01:00
Atomic.h AK: Resolve clang-tidy warnings about unusual assignment operators 2021-11-14 22:52:35 +01:00
Badge.h
Base64.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Base64.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
BinaryBufferWriter.h
BinaryHeap.h AK: Add missing headers 2021-10-06 23:52:40 +01:00
BinarySearch.h
BitCast.h
Bitmap.h AK: Remove unused static member of Bitmap 2021-11-28 13:16:41 -08:00
BitmapView.h AK+Everywhere: Replace __builtin bit functions 2021-12-21 22:13:51 +01:00
BitStream.h
Buffered.h AK: Bypass Buffered's buffer for large reads 2021-12-17 13:13:00 -08:00
BuiltinWrappers.h AK+Everywhere: Replace __builtin bit functions 2021-12-21 22:13:51 +01:00
BumpAllocator.h AK: Make BumpAllocator work in multi-threaded environments 2021-10-31 18:43:03 +01:00
ByteBuffer.h AK: Add ByteBuffer::append(char) 2022-01-09 00:18:46 +01:00
ByteReader.h
CharacterTypes.h
Checked.h AK: Resolve clang-tidy warnings about unusual assignment operators 2021-11-14 22:52:35 +01:00
CheckedFormatString.h AK: Add missing Array.h include to CheckedFormatString.h 2021-12-24 14:35:33 -08:00
CircularDeque.h
CircularDuplexStream.h Everywhere: Fix many spelling errors 2022-01-07 10:56:59 +01:00
CircularQueue.h AK: Resolve clang-tidy readability-bool-conversion warnings 2021-11-14 22:52:35 +01:00
CMakeLists.txt
Complex.h
Concepts.h AK: Add the concept of hash-compatible types 2021-12-15 13:09:49 +03:30
DateTimeLexer.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Debug.h.in LibGUI+AK: Add DRAG_DEBUG opt and put drag operations behind dbgln_if 2022-01-10 14:23:04 +01:00
Demangle.h AK: Don't include AK::demangle() in KERNEL builds 2021-12-26 21:22:59 +01:00
DisjointChunks.h AK: Make Disjoint*::is_empty() not call size 2021-12-24 05:55:34 -08:00
DistinctNumeric.h Everywhere: Fix many spelling errors 2022-01-07 10:56:59 +01:00
DoublyLinkedList.h
Endian.h
EnumBits.h
Error.h AK+LibMain: Improve formatter for AK::Error in userspace 2021-12-20 21:13:42 +01:00
ExtraMathConstants.h
FileStream.h
Find.h
FixedArray.h AK: Reorder functions in FixedArray so that mutable comes before const 2022-01-08 22:54:05 +01:00
FixedPoint.h AK: Convert AK::Format formatting helpers to returning ErrorOr<void> 2021-11-17 00:21:13 +01:00
FlyString.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
FlyString.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Format.cpp Kernel: Wrap format timespec assignment in a check for !AARCH64 2021-11-21 09:12:16 +01:00
Format.h AK+LibMain: Improve formatter for AK::Error in userspace 2021-12-20 21:13:42 +01:00
Forward.h AK: Forward declare Error and ErrorOr in AK/Forward.h 2021-11-17 00:21:12 +01:00
Function.h AK: Suppress false positive readability-non-const-parameter in Function 2021-11-14 22:52:35 +01:00
GenericLexer.cpp
GenericLexer.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
HashFunctions.h AK: Use a full-period xorshift PRNG for double_hash 2022-01-07 12:34:44 +01:00
HashMap.h AK: Make Hash{Map,Table}::remove_all_matching() return removal success 2022-01-05 18:57:14 +01:00
HashTable.h AK: Make Hash{Map,Table}::remove_all_matching() return removal success 2022-01-05 18:57:14 +01:00
Hex.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Hex.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
IDAllocator.h
IntrusiveDetails.h AK: Add missing headers 2021-10-06 23:52:40 +01:00
IntrusiveList.h AK+Everywhere: Reduce the number of template parameters of IntrusiveList 2021-09-10 18:05:46 +03:00
IntrusiveListRelaxedConst.h AK+Everywhere: Reduce the number of template parameters of IntrusiveList 2021-09-10 18:05:46 +03:00
IntrusiveRedBlackTree.h AK+Kernel: Reduce the number of template parameters of IntrusiveRBTree 2021-09-10 18:05:46 +03:00
IPv4Address.h AK: Convert AK::Format formatting helpers to returning ErrorOr<void> 2021-11-17 00:21:13 +01:00
IterationDecision.h
Iterator.h
JsonArray.h AK: Add implied const qualifiers to the Json interface 2021-12-15 23:35:14 -08:00
JsonArraySerializer.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
JsonObject.h AK: Add implied const qualifiers to the Json interface 2021-12-15 23:35:14 -08:00
JsonObjectSerializer.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
JsonParser.cpp AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional) 2021-11-17 00:21:10 +01:00
JsonParser.h AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional) 2021-11-17 00:21:10 +01:00
JsonPath.cpp AK: Add implied const qualifiers to the Json interface 2021-12-15 23:35:14 -08:00
JsonPath.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
JsonValue.cpp AK: Make JsonValue::from_string("") return a null JsonValue 2021-12-16 22:48:17 +01:00
JsonValue.h AK: Return bool in JsonValue::as_bool() 2021-12-15 23:35:14 -08:00
kmalloc.cpp
kmalloc.h Kernel: Remove the kmalloc_eternal heap :^) 2021-12-28 21:02:38 +01:00
kstdio.h
LEB128.h
LexicalPath.cpp AK: Add LexicalPath::prepend() 2021-11-22 09:03:47 +01:00
LexicalPath.h AK: Add LexicalPath::prepend() 2021-11-22 09:03:47 +01:00
MACAddress.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Math.h AK+Everywhere: Replace __builtin bit functions 2021-12-21 22:13:51 +01:00
MemMem.h AK: Mark MemMem header-only functions as inline rather than static 2021-11-22 05:23:24 +03:30
Memory.h AK: Add secure_zero() implementation so it can be used on all platforms 2021-09-13 00:02:42 +02:00
MemoryStream.h
NeverDestroyed.h
NoAllocationGuard.h AK+LibC+LibPthread: Introduce NoAllocationGuard 2022-01-11 00:08:58 +01:00
Noncopyable.h
NonnullOwnPtr.h AK: Mark smart pointer classes as [[nodiscard]] 2021-12-05 15:31:03 +01:00
NonnullOwnPtrVector.h
NonnullPtrVector.h AK: Use default constructor/destructor instead of declaring an empty one 2021-09-16 17:17:13 +02:00
NonnullRefPtr.h AK: Mark smart pointer classes as [[nodiscard]] 2021-12-05 15:31:03 +01:00
NonnullRefPtrVector.h
NumberFormat.h AK: Added human_readable_time() method for "unsaved changes" dialogs 2022-01-09 20:25:48 -08:00
NumericLimits.h AK: Use proper type for bool NumericLimits::min and max specialization 2021-11-14 22:52:35 +01:00
Optional.h AK: Always inline Optional::release_value() 2021-10-25 14:31:46 +02:00
OwnPtr.h AK: Mark smart pointer classes as [[nodiscard]] 2021-12-05 15:31:03 +01:00
Platform.h AK+Everywhere: Replace __builtin bit functions 2021-12-21 22:13:51 +01:00
PrintfImplementation.h LibC+AK: Implement all sorts of wprintf variants 2021-12-21 21:24:36 +03:30
Ptr32.h
Queue.h AK+Everywhere: Reduce the number of template parameters of IntrusiveList 2021-09-10 18:05:46 +03:00
QuickSort.h
Random.cpp
Random.h AK+LibCore: Standardize on AK_OS_MACOS instead of __APPLE__ 2021-09-12 18:31:10 +02:00
RecursionDecision.h
RedBlackTree.h AK: Make RedBlackTree::try_insert() return ErrorOr<void> instead of bool 2021-11-18 21:11:30 +01:00
RefCounted.h AK: Unbreak ref counting hooks in RefCounted 2022-01-08 19:38:00 +01:00
RefCountForwarder.h AK: Add RefCountForwarder<T> 2021-12-09 21:28:52 +01:00
RefPtr.h AK: Mark smart pointer classes as [[nodiscard]] 2021-12-05 15:31:03 +01:00
Result.h AK: Allow to "get a result" from Result<void> 2021-11-28 13:33:51 -08:00
ScopedValueRollback.h
ScopeGuard.h
ScopeLogger.h
SIMD.h
SIMDExtras.h AK/SIMD: Suppress psabi warnings and add explanatory comment 2022-01-09 21:03:08 +01:00
SIMDMath.h AK/SIMD: Suppress psabi warnings and add explanatory comment 2022-01-09 21:03:08 +01:00
Singleton.h Kernel: Split ScopedCritical so header is platform independent 2021-10-15 21:48:45 +01:00
SinglyLinkedList.h
SinglyLinkedListWithCount.h
SourceGenerator.h
SourceLocation.h AK: Convert AK::Format formatting helpers to returning ErrorOr<void> 2021-11-17 00:21:13 +01:00
Span.h AK: Use __builtin_memmove for ByteBuffer and Span's overwrite 2021-12-16 22:21:35 +03:30
Stack.h AK: Use unchecked_append in AK::Stack, as we always validate the size 2022-01-05 14:04:18 +01:00
StackInfo.cpp AK: Fix preprocessor OS check 2021-12-12 11:10:34 -08:00
StackInfo.h
Statistics.h AK: Add min and max functions to Statistics 2021-11-06 22:09:25 -07:00
StdLibExtraDetails.h AK: Add the concept of hash-compatible types 2021-12-15 13:09:49 +03:30
StdLibExtras.h AK: Add mix 2022-01-04 17:48:28 +00:00
Stream.h LibIPC+IPCCompiler+AK: Make IPC value decoders return ErrorOr<void> 2021-11-28 23:14:19 +01:00
String.cpp AK: Convert AK::Format formatting helpers to returning ErrorOr<void> 2021-11-17 00:21:13 +01:00
String.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
StringBuilder.cpp Kernel+AK: Eliminate a couple of temporary String allocations 2021-12-30 14:16:03 +01:00
StringBuilder.h AK: Increase StringBuilder's inline buffer size from 128 to 256 bytes 2021-12-26 01:42:58 +01:00
StringHash.h AK: Allow seed value to be specified in string_hash() 2021-10-25 23:37:18 +02:00
StringImpl.cpp AK: Add fast path for constructing StringImpl from "" literal 2021-10-25 13:29:44 +02:00
StringImpl.h AK: Convert AK::Format formatting helpers to returning ErrorOr<void> 2021-11-17 00:21:13 +01:00
StringUtils.cpp AK: Add convert_to_uint_from_octal 2021-12-21 13:13:04 -08:00
StringUtils.h AK: Add convert_to_uint_from_octal 2021-12-21 13:13:04 -08:00
StringView.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
StringView.h AK: Verify that we are not overreaching in StringView's substring_view() 2021-11-16 00:49:48 +00:00
TemporaryChange.h
Time.cpp
Time.h AK: Add Time.h helper to compute the number of days since epoch 2022-01-05 20:05:12 +01:00
Traits.h AK: Add dedicated Traits for c-strings 2021-12-15 13:09:49 +03:30
Trie.h AK: Use MUST + try_empend so AK::Trie continues to compile in the kernel 2022-01-05 14:04:18 +01:00
Try.h AK+LibJS: Simplify MUST() and move it from LibJS to AK/Try.h 2021-11-10 21:58:58 +01:00
Tuple.h
TypeCasts.h
TypedTransfer.h AK: Fast path for single-element TypedTransfer::copy 2021-12-17 13:13:00 -08:00
TypeList.h
Types.h AK+Kernel: Suppress clang-tidy warnings from the cert-* category 2021-11-14 22:52:35 +01:00
UBSanitizer.h AK+LibSanitizer: Add method to zero out a UBSAN SourceLocation 2021-12-15 10:30:32 -08:00
UFixedBigInt.h AK: Fix UFixedBigInt comparison operators 2022-01-04 06:01:22 +00:00
UnicodeUtils.cpp
UnicodeUtils.h LibC: Implement wcrtomb 2021-10-15 21:50:19 -07:00
URL.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
URL.h AK: Convert AK::Format formatting helpers to returning ErrorOr<void> 2021-11-17 00:21:13 +01:00
URLParser.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
URLParser.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Userspace.h AK+Kernel: Remove implicit conversion from Userspace<T*> to FlatPtr 2021-11-16 00:13:22 +01:00
Utf8View.cpp AK: Inline all the trivial Utf8View functions 2021-09-18 19:54:24 +02:00
Utf8View.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Utf16View.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Utf16View.h AK: Convert AK::Format formatting helpers to returning ErrorOr<void> 2021-11-17 00:21:13 +01:00
Utf32View.h
UUID.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
UUID.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Variant.h AK: Remove Variant<Ts...>::operator Variant<NewTs...>() 2021-12-25 18:24:43 +03:30
Vector.h AK: Make Vector::remove_all_matching() return removal success 2022-01-05 18:57:14 +01:00
Weakable.h Everywhere: Fix spelling mistakes 2022-01-07 15:44:42 +01:00
WeakPtr.h AK: Mark smart pointer classes as [[nodiscard]] 2021-12-05 15:31:03 +01:00