String with length 0 considered to be compressible,
so the length should be -
2147483648 or -(1 << 31).
Change-Id: Ie71f17a0e66efe9a65a8a76d4cee776db636550f
template <bool kIsInstrumented>
inline String* String::AllocEmptyString(Thread* self, gc::AllocatorType allocator_type) {
- SetStringCountVisitor visitor(0);
- return Alloc<kIsInstrumented>(self, 0, allocator_type, visitor);
+ const int32_t length_with_flag = String::GetFlaggedCount(0);
+ SetStringCountVisitor visitor(length_with_flag);
+ return Alloc<kIsInstrumented>(self, length_with_flag, allocator_type, visitor);
}
template <bool kIsInstrumented>