Skip to content

Commit fd369cd

Browse files
authored
[Runtime] Refactor layout string code (#66831)
Made the code a bit more readable by adding a reader and writer type that encapsulate the layout string and offset.
1 parent 3676379 commit fd369cd

File tree

5 files changed

+274
-284
lines changed

5 files changed

+274
-284
lines changed

include/swift/Runtime/Metadata.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,10 @@ inline LayoutStringFlags &operator|=(LayoutStringFlags &a, LayoutStringFlags b)
688688
SWIFT_RUNTIME_STDLIB_INTERNAL
689689
size_t _swift_refCountBytesForMetatype(const Metadata *type);
690690

691+
struct LayoutStringWriter;
692+
691693
SWIFT_RUNTIME_STDLIB_INTERNAL
692-
void _swift_addRefCountStringForMetatype(uint8_t *layoutStr,
693-
size_t &layoutStrOffset,
694+
void _swift_addRefCountStringForMetatype(LayoutStringWriter &writer,
694695
LayoutStringFlags &flags,
695696
const Metadata *fieldType,
696697
size_t &fullOffset,

0 commit comments

Comments
 (0)