mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
AK: Reduce String's allocated data by one byte
This was copied from allocation_size_for_stringimpl, which had to ensure the string is null-terminated. String makes no such guarantee.
This commit is contained in:
parent
c111536f28
commit
ef275e25b8
Notes:
sideshowbarker
2024-07-17 01:23:08 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/ef275e25b8 Pull-request: https://github.com/SerenityOS/serenity/pull/17136
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ StringData::~StringData()
|
|||
|
||||
constexpr size_t allocation_size_for_string_data(size_t length)
|
||||
{
|
||||
return sizeof(StringData) + (sizeof(char) * length) + sizeof(char);
|
||||
return sizeof(StringData) + (sizeof(char) * length);
|
||||
}
|
||||
|
||||
ErrorOr<NonnullRefPtr<StringData>> StringData::create_uninitialized(size_t byte_count, u8*& buffer)
|
||||
|
|
Loading…
Reference in a new issue