| OLD | NEW |
| 1 // Copyright (c) 2006, Google Inc. | 1 // Copyright (c) 2006, Google Inc. |
| 2 // All rights reserved. | 2 // 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 class RangeMap { | 53 class RangeMap { |
| 54 public: | 54 public: |
| 55 RangeMap() : enable_shrink_down_(false), map_() {} | 55 RangeMap() : enable_shrink_down_(false), map_() {} |
| 56 | 56 |
| 57 // |enable_shrink_down| tells whether overlapping ranges can be shrunk down. | 57 // |enable_shrink_down| tells whether overlapping ranges can be shrunk down. |
| 58 // If true, then adding a new range that overlaps with an existing one can | 58 // If true, then adding a new range that overlaps with an existing one can |
| 59 // be a successful operation. The range which ends at the higher address | 59 // be a successful operation. The range which ends at the higher address |
| 60 // will be shrunk down by moving its start position to a higher address so | 60 // will be shrunk down by moving its start position to a higher address so |
| 61 // that it does not overlap anymore. | 61 // that it does not overlap anymore. |
| 62 void SetEnableShrinkDown(bool enable_shrink_down); | 62 void SetEnableShrinkDown(bool enable_shrink_down); |
| 63 bool IsShrinkDownEnabled() const; |
| 63 | 64 |
| 64 // Inserts a range into the map. Returns false for a parameter error, | 65 // Inserts a range into the map. Returns false for a parameter error, |
| 65 // or if the location of the range would conflict with a range already | 66 // or if the location of the range would conflict with a range already |
| 66 // stored in the map. If enable_shrink_down is true and there is an overlap | 67 // stored in the map. If enable_shrink_down is true and there is an overlap |
| 67 // between the current range and some other range (already in the map), | 68 // between the current range and some other range (already in the map), |
| 68 // shrink down the range which ends at a higher address. | 69 // shrink down the range which ends at a higher address. |
| 69 bool StoreRange(const AddressType &base, const AddressType &size, | 70 bool StoreRange(const AddressType &base, const AddressType &size, |
| 70 const EntryType &entry); | 71 const EntryType &entry); |
| 71 | 72 |
| 72 // Locates the range encompassing the supplied address. If there is no such | 73 // Locates the range encompassing the supplied address. If there is no such |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 152 |
| 152 // Maps the high address of each range to a EntryType. | 153 // Maps the high address of each range to a EntryType. |
| 153 AddressToRangeMap map_; | 154 AddressToRangeMap map_; |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 | 157 |
| 157 } // namespace google_breakpad | 158 } // namespace google_breakpad |
| 158 | 159 |
| 159 | 160 |
| 160 #endif // PROCESSOR_RANGE_MAP_H__ | 161 #endif // PROCESSOR_RANGE_MAP_H__ |
| OLD | NEW |