Skip to content

Commit ec71405

Browse files
authored
Merge pull request swiftlang#24628 from marcrasi/textowner-sized-deallocation
2 parents 7ce150b + 922fdfa commit ec71405

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/swift/Basic/OwnedString.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ class OwnedString {
4646
return new (data) TextOwner(Text);
4747
}
4848

49+
/// Disable sized deallocation for TextOwner, because it has tail-allocated
50+
/// data.
51+
void operator delete(void *p) { ::operator delete(p); }
52+
4953
const char *getText() const { return getTrailingObjects<char>(); }
5054
};
5155

0 commit comments

Comments
 (0)