From 8cace3f05003c6cb4d38c36890055f03151c2ad4 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Fri, 16 Oct 2026 02:39:56 +0800 Subject: Remove old code Signed-off-by: Richard Qin --- lib/ktl/stub-new.cc | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 lib/ktl/stub-new.cc (limited to 'lib/ktl/stub-new.cc') diff --git a/lib/ktl/stub-new.cc b/lib/ktl/stub-new.cc deleted file mode 100644 index 919d941..0000000 --- a/lib/ktl/stub-new.cc +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2020 The Fuchsia Authors -// -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file or at -// https://opensource.org/licenses/MIT - -#include - -// std::stable_sort (used as ktl::stable_sort) uses std::get_temporary_buffer, -// which uses operator new to request a temporary buffer but then works fine -// if it can't get one. There is no "default" memory allocation in the -// kernel, so just provide a stub operator new that always fails so -// std::stable_sort falls back to its no-allocation algorithm. - -namespace std { - -const nothrow_t nothrow; - -} // namespace std - -void* operator new(std::size_t, const std::nothrow_t&) noexcept { return nullptr; } - -void* operator new(std::size_t, std::align_val_t, const std::nothrow_t&) noexcept { - return nullptr; -} -- cgit v1.2.3