llvm-svn: 277746
This commit is contained in:
Etienne Bergeron 2016-08-04 18:30:41 +00:00
parent 27eb6d521e
commit d2b37ada4d
1 changed files with 3 additions and 2 deletions

View File

@ -98,7 +98,8 @@ class SizeClassAllocator64 {
if (kUsingConstantSpaceBeg) if (kUsingConstantSpaceBeg)
return reinterpret_cast<uptr>(p) & ~(kRegionSize - 1); return reinterpret_cast<uptr>(p) & ~(kRegionSize - 1);
uptr space_beg = SpaceBeg(); uptr space_beg = SpaceBeg();
return ((reinterpret_cast<uptr>(p) - space_beg) & ~(kRegionSize - 1)) + space_beg; return ((reinterpret_cast<uptr>(p) - space_beg) & ~(kRegionSize - 1)) +
space_beg;
} }
uptr GetSizeClass(const void *p) { uptr GetSizeClass(const void *p) {
@ -113,7 +114,7 @@ class SizeClassAllocator64 {
uptr size = SizeClassMap::Size(class_id); uptr size = SizeClassMap::Size(class_id);
if (!size) return nullptr; if (!size) return nullptr;
uptr chunk_idx = GetChunkIdx((uptr)p, size); uptr chunk_idx = GetChunkIdx((uptr)p, size);
uptr reg_beg = GetRegionBegin(p); uptr reg_beg = GetRegionBegin(p);
uptr beg = chunk_idx * size; uptr beg = chunk_idx * size;
uptr next_beg = beg + size; uptr next_beg = beg + size;
if (class_id >= kNumClasses) return nullptr; if (class_id >= kNumClasses) return nullptr;