Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(829)

Side by Side Diff: third_party/WebKit/Source/platform/heap/HeapPage.h

Issue 1884083002: Revert of Rename Heap to ThreadHeap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 const size_t largeObjectSizeThreshold = blinkPageSize / 2; 78 const size_t largeObjectSizeThreshold = blinkPageSize / 2;
79 79
80 // A zap value used for freed memory that is allowed to be added to the free 80 // A zap value used for freed memory that is allowed to be added to the free
81 // list in the next addToFreeList(). 81 // list in the next addToFreeList().
82 const uint8_t reuseAllowedZapValue = 0x2a; 82 const uint8_t reuseAllowedZapValue = 0x2a;
83 // A zap value used for freed memory that is forbidden to be added to the free 83 // A zap value used for freed memory that is forbidden to be added to the free
84 // list in the next addToFreeList(). 84 // list in the next addToFreeList().
85 const uint8_t reuseForbiddenZapValue = 0x2c; 85 const uint8_t reuseForbiddenZapValue = 0x2c;
86 86
87 // In non-production builds, memory is zapped when it's freed. The zapped 87 // In non-production builds, memory is zapped when it's freed. The zapped
88 // memory is zeroed out when the memory is reused in ThreadHeap::allocateObject( ). 88 // memory is zeroed out when the memory is reused in Heap::allocateObject().
89 // In production builds, memory is not zapped (for performance). The memory 89 // In production builds, memory is not zapped (for performance). The memory
90 // is just zeroed out when it is added to the free list. 90 // is just zeroed out when it is added to the free list.
91 #if defined(MEMORY_SANITIZER) 91 #if defined(MEMORY_SANITIZER)
92 // TODO(kojii): We actually need __msan_poison/unpoison here, but it'll be 92 // TODO(kojii): We actually need __msan_poison/unpoison here, but it'll be
93 // added later. 93 // added later.
94 #define SET_MEMORY_INACCESSIBLE(address, size) \ 94 #define SET_MEMORY_INACCESSIBLE(address, size) \
95 FreeList::zapFreedMemory(address, size); 95 FreeList::zapFreedMemory(address, size);
96 #define SET_MEMORY_ACCESSIBLE(address, size) \ 96 #define SET_MEMORY_ACCESSIBLE(address, size) \
97 memset((address), 0, (size)) 97 memset((address), 0, (size))
98 #define CHECK_MEMORY_INACCESSIBLE(address, size) \ 98 #define CHECK_MEMORY_INACCESSIBLE(address, size) \
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 SET_MEMORY_ACCESSIBLE(result, allocationSize - sizeof(HeapObjectHeader)) ; 886 SET_MEMORY_ACCESSIBLE(result, allocationSize - sizeof(HeapObjectHeader)) ;
887 ASSERT(findPageFromAddress(headerAddress + allocationSize - 1)); 887 ASSERT(findPageFromAddress(headerAddress + allocationSize - 1));
888 return result; 888 return result;
889 } 889 }
890 return outOfLineAllocate(allocationSize, gcInfoIndex); 890 return outOfLineAllocate(allocationSize, gcInfoIndex);
891 } 891 }
892 892
893 } // namespace blink 893 } // namespace blink
894 894
895 #endif // HeapPage_h 895 #endif // HeapPage_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/HeapAllocator.h ('k') | third_party/WebKit/Source/platform/heap/HeapPage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698