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 715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 uint32_t end = ::GetTickCount(); | 726 uint32_t end = ::GetTickCount(); |
727 AsanRuntime* runtime = AsanRuntime::runtime(); | 727 AsanRuntime* runtime = AsanRuntime::runtime(); |
728 DCHECK_NE(static_cast<AsanRuntime*>(nullptr), runtime); | 728 DCHECK_NE(static_cast<AsanRuntime*>(nullptr), runtime); |
729 uint32_t begin = runtime->starting_ticks(); | 729 uint32_t begin = runtime->starting_ticks(); |
730 if (ticks < begin || ticks > end) | 730 if (ticks < begin || ticks > end) |
731 return false; | 731 return false; |
732 return true; | 732 return true; |
733 } | 733 } |
734 | 734 |
735 // Determines if a heap id is valid by referring to the runtime. | 735 // Determines if a heap id is valid by referring to the runtime. |
736 bool IsValidHeapId(uint32_t heap_id) { | 736 bool IsValidHeapId(size_t heap_id) { |
737 AsanRuntime* runtime = AsanRuntime::runtime(); | 737 AsanRuntime* runtime = AsanRuntime::runtime(); |
738 DCHECK_NE(static_cast<AsanRuntime*>(nullptr), runtime); | 738 DCHECK_NE(static_cast<AsanRuntime*>(nullptr), runtime); |
739 if (!runtime->HeapIdIsValid(heap_id)) | 739 if (!runtime->HeapIdIsValid(heap_id)) |
740 return false; | 740 return false; |
741 return true; | 741 return true; |
742 } | 742 } |
743 | 743 |
744 bool BlockHeaderIsConsistent(BlockState block_state, | 744 bool BlockHeaderIsConsistent(BlockState block_state, |
745 const BlockInfo& block_info) { | 745 const BlockInfo& block_info) { |
746 const BlockHeader* h = block_info.header; | 746 const BlockHeader* h = block_info.header; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 void SetOnExceptionCallback(OnExceptionCallback callback) { | 943 void SetOnExceptionCallback(OnExceptionCallback callback) { |
944 g_on_exception_callback = callback; | 944 g_on_exception_callback = callback; |
945 } | 945 } |
946 | 946 |
947 void ClearOnExceptionCallback() { | 947 void ClearOnExceptionCallback() { |
948 g_on_exception_callback.Reset(); | 948 g_on_exception_callback.Reset(); |
949 } | 949 } |
950 | 950 |
951 } // namespace asan | 951 } // namespace asan |
952 } // namespace agent | 952 } // namespace agent |
OLD | NEW |