7 Commits
Author SHA1 Message Date
Doug Gregor 3b10d15a65 Merge pull request #848 from sandeepvijayarao09/fix-trailing-array-throwing-init
[TrailingElements] Don't deinitialize elements when the initializer throws
2026-11-21 14:50:19 -08:00
Doug Gregor 43367db377 [TrailingArray] Handle trailing arrays where the element has greater alignment than the header
When this happens, we over-allocate and use the alignment of the
elements, and then move the start of the header after the point of
allocation such that the properly-aligned elements follow it
immediately.
2025-09-12 11:23:07 -07:00
Doug Gregor aa36f635ad Rename PaddedStorage to TrailingPadding 2025-09-08 18:59:45 -07:00
Doug Gregor e08ba6087d [TrailingElementsModule] Rename "takePointer" to "leakStorage", which is more descriptive 2025-09-08 18:56:51 -07:00
Doug Gregor b6208a9836 Rename IntrusiveManagedBuffer to TrailingArray 2025-09-08 18:54:48 -07:00
Doug Gregor ad56b1c8c4 [TrailingElementsModule] Underscore internal, ABI-exposed stored properties 2025-09-08 18:52:47 -07:00
Doug Gregor 2e7fb3e12a Add "trailing elements" module with facilities for tail-allocated storage
Introduce new types `IntrusiveManagedBuffer` and `PaddedStorage` that
consist of a fixed-sized header followed by variable-sized storage. The
design of these types is inspired by the existing `ManagedBuffer` type
in the standard library, but has been adjusted both to make them
non-copyable and to eliminate the requirement for heap allocation.
2025-09-05 15:52:27 -07:00