OLD | NEW |
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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 uint32_t alloc_tid; | 201 uint32_t alloc_tid; |
202 uint32_t free_tid; | 202 uint32_t free_tid; |
203 // The time at which the block was allocated. Combined with the address of | 203 // The time at which the block was allocated. Combined with the address of |
204 // the block itself this acts as a (unique with high probability) serial | 204 // the block itself this acts as a (unique with high probability) serial |
205 // number for the block (especially if the heap is lazy to reuse | 205 // number for the block (especially if the heap is lazy to reuse |
206 // allocations). | 206 // allocations). |
207 uint32_t alloc_ticks; | 207 uint32_t alloc_ticks; |
208 // The time at which the block was freed (zero if not yet freed). | 208 // The time at which the block was freed (zero if not yet freed). |
209 uint32_t free_ticks; | 209 uint32_t free_ticks; |
210 // The ID of the heap that allocated the block. | 210 // The ID of the heap that allocated the block. |
211 uint32_t heap_id; | 211 size_t heap_id; |
| 212 #ifdef _WIN64 |
| 213 // Add some padding so the trailer size will be a multiple of size |
| 214 // (n + 1/2) * kShadowRatio. |
| 215 // TODO(sebmarchand): Use this bytes to store more information. |
| 216 uint32_t padding_; |
| 217 #endif |
212 }; | 218 }; |
213 #pragma pack(pop) | 219 #pragma pack(pop) |
214 static_assert((sizeof(BlockTrailer) % kShadowRatio) == (kShadowRatio / 2), | 220 static_assert((sizeof(BlockTrailer) % kShadowRatio) == (kShadowRatio / 2), |
215 "Invalid BlockTrailer mod size."); | 221 "Invalid BlockTrailer mod size."); |
| 222 #ifndef _WIN64 |
216 static_assert(sizeof(BlockTrailer) == 20, "Invalid BlockTrailer size."); | 223 static_assert(sizeof(BlockTrailer) == 20, "Invalid BlockTrailer size."); |
| 224 #else |
| 225 static_assert(sizeof(BlockTrailer) == 28, "Invalid BlockTrailer size."); |
| 226 #endif |
217 | 227 |
218 // A structure for recording the minimum pertinent information about a block. | 228 // A structure for recording the minimum pertinent information about a block. |
219 // Can easily be expanded into a BlockInfo, but requires less space. This makes | 229 // Can easily be expanded into a BlockInfo, but requires less space. This makes |
220 // it suitable for storing blocks in a quarantine, for example. | 230 // it suitable for storing blocks in a quarantine, for example. |
221 // NOTE: If you want to navigate a block thoroughly and conveniently it is best | 231 // NOTE: If you want to navigate a block thoroughly and conveniently it is best |
222 // to first upgrade a CompactBlockInfo to a full BlockInfo struct. | 232 // to first upgrade a CompactBlockInfo to a full BlockInfo struct. |
223 struct CompactBlockInfo { | 233 struct CompactBlockInfo { |
224 // Pointer to the beginning of the allocation. | 234 // Pointer to the beginning of the allocation. |
225 BlockHeader* header; | 235 BlockHeader* header; |
226 // The size of the entire allocation. It's supposed to fit into 30 bits. | 236 // The size of the entire allocation. It's supposed to fit into 30 bits. |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
514 typedef base::Callback<void(EXCEPTION_POINTERS*)> OnExceptionCallback; | 524 typedef base::Callback<void(EXCEPTION_POINTERS*)> OnExceptionCallback; |
515 void SetOnExceptionCallback(OnExceptionCallback callback); | 525 void SetOnExceptionCallback(OnExceptionCallback callback); |
516 void ClearOnExceptionCallback(); | 526 void ClearOnExceptionCallback(); |
517 | 527 |
518 } // namespace asan | 528 } // namespace asan |
519 } // namespace agent | 529 } // namespace agent |
520 | 530 |
521 #include "syzygy/agent/asan/block_impl.h" | 531 #include "syzygy/agent/asan/block_impl.h" |
522 | 532 |
523 #endif // SYZYGY_AGENT_ASAN_BLOCK_H_ | 533 #endif // SYZYGY_AGENT_ASAN_BLOCK_H_ |
OLD | NEW |