From fdf271a7e2687c606a95b64d90d8728d31cdedaa Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Wed, 17 Apr 2019 16:11:41 +0000 Subject: [PATCH] [libc++][NFC] Make size of allocation more self-documenting git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358588 91177308-0d34-0410-b5e6-96231b3b80d8 --- src/debug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/debug.cpp b/src/debug.cpp index 0f75d8ce9..93fa1a8e0 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -171,7 +171,7 @@ __libcpp_db::__insert_c(void* __c, __libcpp_db::_InsertConstruct *__fn) if (__csz_ + 1 > static_cast(__cend_ - __cbeg_)) { size_t nc = __next_prime(2*static_cast(__cend_ - __cbeg_) + 1); - __c_node** cbeg = static_cast<__c_node**>(calloc(nc, sizeof(void*))); + __c_node** cbeg = static_cast<__c_node**>(calloc(nc, sizeof(__c_node*))); if (cbeg == nullptr) __throw_bad_alloc(); @@ -508,7 +508,7 @@ __libcpp_db::__insert_iterator(void* __i) if (__isz_ + 1 > static_cast(__iend_ - __ibeg_)) { size_t nc = __next_prime(2*static_cast(__iend_ - __ibeg_) + 1); - __i_node** ibeg = static_cast<__i_node**>(calloc(nc, sizeof(void*))); + __i_node** ibeg = static_cast<__i_node**>(calloc(nc, sizeof(__i_node*))); if (ibeg == nullptr) __throw_bad_alloc();