| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // ranges. | 46 // ranges. |
| 47 // @returns true if the heap is corrupt, false otherwise. | 47 // @returns true if the heap is corrupt, false otherwise. |
| 48 bool IsHeapCorrupt(CorruptRangesVector* corrupt_ranges); | 48 bool IsHeapCorrupt(CorruptRangesVector* corrupt_ranges); |
| 49 | 49 |
| 50 // TODO(sebmarchand): Add a testing seam that controls the range of memory | 50 // TODO(sebmarchand): Add a testing seam that controls the range of memory |
| 51 // that is walked by HeapChecker to keep unittest times to something | 51 // that is walked by HeapChecker to keep unittest times to something |
| 52 // reasonable. | 52 // reasonable. |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 // Get the information about the corrupt ranges in a heap slab. | 55 // Get the information about the corrupt ranges in a heap slab. |
| 56 // @param lower_bound The lower bound for this slab. | 56 // @param lower_bound The lower bound for this slab (inclusive). |
| 57 // @param length The length of this slab. | 57 // @param upper_bound The upper bound for this slab (exclusive). An |
| 58 // overflowed value of 0 indicates the end of all memory. |
| 58 // @param corrupt_ranges Will receive the information about the corrupt ranges | 59 // @param corrupt_ranges Will receive the information about the corrupt ranges |
| 59 // in this slab. | 60 // in this slab. |
| 60 void GetCorruptRangesInSlab(const uint8_t* lower_bound, | 61 void GetCorruptRangesInSlab(const uint8_t* lower_bound, |
| 61 size_t length, | 62 const uint8_t* upper_bound, |
| 62 CorruptRangesVector* corrupt_ranges); | 63 CorruptRangesVector* corrupt_ranges); |
| 63 | 64 |
| 64 // The shadow memory that will be analyzed. | 65 // The shadow memory that will be analyzed. |
| 65 Shadow* shadow_; | 66 Shadow* shadow_; |
| 66 | 67 |
| 67 DISALLOW_COPY_AND_ASSIGN(HeapChecker); | 68 DISALLOW_COPY_AND_ASSIGN(HeapChecker); |
| 68 }; | 69 }; |
| 69 | 70 |
| 70 } // namespace asan | 71 } // namespace asan |
| 71 } // namespace agent | 72 } // namespace agent |
| 72 | 73 |
| 73 #endif // SYZYGY_AGENT_ASAN_HEAP_CHECKER_H_ | 74 #endif // SYZYGY_AGENT_ASAN_HEAP_CHECKER_H_ |
| OLD | NEW |