mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
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 <fangxinyong@xiaomi.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user