From f1e37a4987af6ad667c5e8b5886dd935cd263bae Mon Sep 17 00:00:00 2001 From: fangxinyong Date: Wed, 3 May 2023 10:21:47 +0800 Subject: [PATCH] libs/libxx: remove redundant code Follow the change: https://github.com/apache/nuttx/pull/9151, that is no need to deal with zero size in C++ allocator. Signed-off-by: fangxinyong --- libs/libxx/libcxxmini/libxx_new.cxx | 7 ------- libs/libxx/libcxxmini/libxx_newa.cxx | 7 ------- 2 files changed, 14 deletions(-) diff --git a/libs/libxx/libcxxmini/libxx_new.cxx b/libs/libxx/libcxxmini/libxx_new.cxx index 997ab87ea2..be78cc7df0 100644 --- a/libs/libxx/libcxxmini/libxx_new.cxx +++ b/libs/libxx/libcxxmini/libxx_new.cxx @@ -48,13 +48,6 @@ FAR void *operator new(std::size_t nbytes) { - // We have to allocate something - - if (nbytes < 1) - { - nbytes = 1; - } - // Perform the allocation FAR void *alloc = lib_malloc(nbytes); diff --git a/libs/libxx/libcxxmini/libxx_newa.cxx b/libs/libxx/libcxxmini/libxx_newa.cxx index f0d3eb07d5..f0788026b6 100644 --- a/libs/libxx/libcxxmini/libxx_newa.cxx +++ b/libs/libxx/libcxxmini/libxx_newa.cxx @@ -56,13 +56,6 @@ FAR void *operator new[](std::size_t nbytes) { - // We have to allocate something - - if (nbytes < 1) - { - nbytes = 1; - } - // Perform the allocation FAR void *alloc = lib_malloc(nbytes);