2017-08-13 02:44:08 +08:00
|
|
|
//***************************************************************************
|
2021-08-29 21:36:24 +08:00
|
|
|
// libs/libxx/libcxxmini/libxx_delete_sized.cxx
|
2017-08-13 02:44:08 +08:00
|
|
|
//
|
2021-02-24 02:12:11 +08:00
|
|
|
// Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
// contributor license agreements. See the NOTICE file distributed with
|
|
|
|
// this work for additional information regarding copyright ownership. The
|
|
|
|
// ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
// "License"); you may not use this file except in compliance with the
|
|
|
|
// License. You may obtain a copy of the License at
|
2017-08-13 02:44:08 +08:00
|
|
|
//
|
2021-02-24 02:12:11 +08:00
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
2017-08-13 02:44:08 +08:00
|
|
|
//
|
2021-02-24 02:12:11 +08:00
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
// License for the specific language governing permissions and limitations
|
2017-08-13 02:44:08 +08:00
|
|
|
//
|
|
|
|
//***************************************************************************
|
|
|
|
|
|
|
|
//***************************************************************************
|
|
|
|
// Included Files
|
|
|
|
//***************************************************************************
|
|
|
|
|
2017-08-15 04:26:59 +08:00
|
|
|
#include <nuttx/compiler.h>
|
2017-08-13 02:44:08 +08:00
|
|
|
|
2020-02-17 20:19:25 +08:00
|
|
|
#include <cstddef>
|
|
|
|
|
2021-08-29 21:36:24 +08:00
|
|
|
#include <nuttx/lib/lib.h>
|
2017-08-13 02:44:08 +08:00
|
|
|
|
2017-08-15 04:26:59 +08:00
|
|
|
#ifdef CONFIG_HAVE_CXX14
|
|
|
|
|
2017-08-13 02:44:08 +08:00
|
|
|
//***************************************************************************
|
|
|
|
// Operators
|
|
|
|
//***************************************************************************
|
|
|
|
|
|
|
|
//***************************************************************************
|
|
|
|
// Name: delete
|
|
|
|
//
|
|
|
|
// NOTE:
|
|
|
|
// This should take a type of size_t. But size_t has an unknown underlying
|
|
|
|
// type. In the nuttx sys/types.h header file, size_t is typed as uint32_t
|
|
|
|
// (which is determined by architecture-specific logic). But the C++
|
|
|
|
// compiler may believe that size_t is of a different type resulting in
|
|
|
|
// compilation errors in the operator. Using the underlying integer type
|
|
|
|
// instead of size_t seems to resolve the compilation issues. Need to
|
|
|
|
// REVISIT this.
|
|
|
|
//
|
|
|
|
//***************************************************************************
|
|
|
|
|
2020-02-17 20:19:25 +08:00
|
|
|
void operator delete(FAR void *ptr, std::size_t size)
|
2017-08-13 02:44:08 +08:00
|
|
|
{
|
|
|
|
lib_free(ptr);
|
|
|
|
}
|
2017-08-15 04:26:59 +08:00
|
|
|
|
|
|
|
#endif /* CONFIG_HAVE_CXX14 */
|