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

Side by Side Diff: syzygy/agent/asan/heap_managers/block_heap_manager.cc

Issue 2508333002: Remove the is_nested bit from the BlockInfo structure. (Closed)
Patch Set: Address Siggi's comments. Created 4 years, 1 month 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 // Copyright 2014 Google Inc. All Rights Reserved. 1 // Copyright 2014 Google Inc. All Rights Reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 } 226 }
227 } 227 }
228 228
229 // The allocation can fail if we're out of memory. 229 // The allocation can fail if we're out of memory.
230 if (alloc == nullptr) 230 if (alloc == nullptr)
231 return nullptr; 231 return nullptr;
232 232
233 DCHECK_NE(static_cast<void*>(nullptr), alloc); 233 DCHECK_NE(static_cast<void*>(nullptr), alloc);
234 DCHECK_EQ(0u, reinterpret_cast<size_t>(alloc) % kShadowRatio); 234 DCHECK_EQ(0u, reinterpret_cast<size_t>(alloc) % kShadowRatio);
235 BlockInfo block = {}; 235 BlockInfo block = {};
236 BlockInitialize(block_layout, alloc, false, &block); 236 BlockInitialize(block_layout, alloc, &block);
237 237
238 // Poison the redzones in the shadow memory as early as possible. 238 // Poison the redzones in the shadow memory as early as possible.
239 shadow_->PoisonAllocatedBlock(block); 239 shadow_->PoisonAllocatedBlock(block);
240 240
241 block.header->alloc_stack = stack_cache_->SaveStackTrace(stack); 241 block.header->alloc_stack = stack_cache_->SaveStackTrace(stack);
242 block.header->free_stack = nullptr; 242 block.header->free_stack = nullptr;
243 block.header->state = ALLOCATED_BLOCK; 243 block.header->state = ALLOCATED_BLOCK;
244 244
245 block.trailer->heap_id = heap_id; 245 block.trailer->heap_id = heap_id;
246 246
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 if (trailer_has_valid_heap_id) 1112 if (trailer_has_valid_heap_id)
1113 return block_info->trailer->heap_id; 1113 return block_info->trailer->heap_id;
1114 1114
1115 // Unfortunately, there's no way to know which heap this block belongs to. 1115 // Unfortunately, there's no way to know which heap this block belongs to.
1116 return 0; 1116 return 0;
1117 } 1117 }
1118 1118
1119 } // namespace heap_managers 1119 } // namespace heap_managers
1120 } // namespace asan 1120 } // namespace asan
1121 } // namespace agent 1121 } // namespace agent
OLDNEW
« no previous file with comments | « syzygy/agent/asan/heap_checker_unittest.cc ('k') | syzygy/agent/asan/heaps/large_block_heap_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698