diff options
author | Wyatt Hepler <hepler@google.com> | 2020-06-18 09:46:02 -0700 |
---|---|---|
committer | CQ Bot Account <commit-bot@chromium.org> | 2020-06-23 21:03:05 +0000 |
commit | fc988dcd9f3a73e52d34aa31ee4eadfa19350ad7 (patch) | |
tree | a665e8806086c45ed14fff953294fbbdb60550ca /pw_allocator | |
parent | 6d1a6c69393c244386ca069540334ba63ea8018d (diff) | |
download | pigweed-fc988dcd9f3a73e52d34aa31ee4eadfa19350ad7.tar.gz |
pw_allocator: Remove unnecessary reinterpret_casts
Change-Id: Ieb0978733fada91189cadd39fdeb686a035545f2
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12603
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Jamie Garside <jgarside@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
Diffstat (limited to 'pw_allocator')
-rw-r--r-- | pw_allocator/freelist_heap.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pw_allocator/freelist_heap.cc b/pw_allocator/freelist_heap.cc index 9ff5044e1..7966bb89f 100644 --- a/pw_allocator/freelist_heap.cc +++ b/pw_allocator/freelist_heap.cc @@ -52,7 +52,7 @@ void* FreeListHeap::Allocate(size_t size) { } void FreeListHeap::Free(void* ptr) { - std::byte* bytes = reinterpret_cast<std::byte*>(ptr); + std::byte* bytes = static_cast<std::byte*>(ptr); if (bytes < region_.data() || bytes >= region_.data() + region_.size()) { return; @@ -102,7 +102,7 @@ void* FreeListHeap::Realloc(void* ptr, size_t size) { return Allocate(size); } - std::byte* bytes = reinterpret_cast<std::byte*>(ptr); + std::byte* bytes = static_cast<std::byte*>(ptr); // TODO(chenghanzh): Enhance with debug information for out-of-range and more. if (bytes < region_.data() || bytes >= region_.data() + region_.size()) { |