Skip to content

Commit 922fdfa

Browse files
author
Marc Rasi
committed
disable sized deallocation for TextOwner
1 parent 6b1af3d commit 922fdfa

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)