You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"This template library is a collection of template-oriented code that we, the Data Science Group at UPB, found pretty handy. It contains: `switch_cases` (Use runtime values in compile-time context), `integral_template_tuple` (Create a tuple-like structure that instantiates a template for a range of values), `integral_template_variant` (A wrapper type for `std::variant` guarantees to only contain variants of the form `T<IX>` and `for_{types,values,range}` (Compile time for loops for types, values or ranges))."
Copy file name to clipboardexpand all lines: README.md
+14
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ It contains:
9
9
-`integral_template_variant`: A wrapper type for `std::variant` guarantees to only contain variants of the form `T<ix>` where $\texttt{ix}\in [\texttt{first},\texttt{last}]$ (inclusive).
10
10
-`for_{types,values,range}`: Compile time for loops for types, values or ranges
11
11
-`polymorphic_allocator`: Like `std::pmr::polymorphic_allocator` but with static dispatch
12
+
-`limit_allocator`: Allocator wrapper that limits the amount of memory that is allowed to be allocated
13
+
-`pool` & `pool_allocator`: Arena/pool allocator optimized for a limited number of known allocation sizes.
12
14
-`DICE_DEFER`/`DICE_DEFER_TO_SUCCES`/`DICE_DEFER_TO_FAIL`: On-the-fly RAII for types that do not support it natively (similar to go's `defer` keyword)
13
15
-`overloaded`: Composition for `std::variant` visitor lambdas
14
16
-`flex_array`: A combination of `std::array`, `std::span` and a `vector` with small buffer optimization
@@ -64,6 +66,15 @@ The problem with `mmap` allocations is that they will be placed at an arbitrary
64
66
therefore absolute pointers will cause segfaults if the segment is reloaded.
65
67
Which means: vtables will not work (because they use absolute pointers) and therefore you cannot use `std::pmr::polymorphic_allocator`.
66
68
69
+
### `limit_allocator`
70
+
Allocator wrapper that limits the amount of memory that can be allocated through the inner allocator.
71
+
If the limit is exceeded it will throw `std::bad_alloc`.
72
+
73
+
### `pool_allocator`
74
+
A memory arena/pool allocator with configurable allocation sizes. This is implemented
75
+
as a collection of pools with varying allocation sizes. Allocations that do not
76
+
fit into any of its pools are directly served via `new`.
0 commit comments