From 1003013f10cc67694716962337f2aeeb13407877 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sat, 31 May 2025 12:57:50 -0700 Subject: [PATCH] remove allocators.h Unused. Signed-off-by: Rosen Penev --- Makefile.am | 1 - rak/allocators.h | 110 ------------------------------------------- src/rpc/scgi_task.cc | 1 - 3 files changed, 112 deletions(-) delete mode 100644 rak/allocators.h diff --git a/Makefile.am b/Makefile.am index 219b5a71..5e1fe87a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,7 +7,6 @@ EXTRA_DIST= \ rtorrent.lua \ rak/address_info.h \ rak/algorithm.h \ - rak/allocators.h \ rak/error_number.h \ rak/file_stat.h \ rak/fs_stat.h \ diff --git a/rak/allocators.h b/rak/allocators.h deleted file mode 100644 index 0a1b7117..00000000 --- a/rak/allocators.h +++ /dev/null @@ -1,110 +0,0 @@ -// rak - Rakshasa's toolbox -// Copyright (C) 2005-2007, Jari Sundell -// -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// In addition, as a special exception, the copyright holders give -// permission to link the code of portions of this program with the -// OpenSSL library under certain conditions as described in each -// individual source file, and distribute linked combinations -// including the two. -// -// You must obey the GNU General Public License in all respects for -// all of the code used other than OpenSSL. If you modify file(s) -// with this exception, you may extend this exception to your version -// of the file(s), but you are not obligated to do so. If you do not -// wish to do so, delete this exception statement from your version. -// If you delete this exception statement from all source files in the -// program, then also delete it here. -// -// Contact: Jari Sundell -// -// Skomakerveien 33 -// 3185 Skoppum, NORWAY - -// Some allocators for cacheline aligned chunks of memory, etc. - -#ifndef RAK_ALLOCATORS_H -#define RAK_ALLOCATORS_H - -#include -#include -#include -#include - -namespace rak { - -template -class cacheline_allocator { -public: - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T* pointer; - typedef const T* const_pointer; - typedef const void* const_void_pointer; - typedef T& reference; - typedef const T& const_reference; - typedef T value_type; - - cacheline_allocator() throw() { } - cacheline_allocator(const cacheline_allocator&) throw() { } - template - cacheline_allocator(const cacheline_allocator&) throw() { } - ~cacheline_allocator() throw() { } - - template - struct rebind { typedef cacheline_allocator other; }; - - // return address of values - pointer address (reference value) const { return &value; } - const_pointer address (const_reference value) const { return &value; } - - size_type max_size () const throw() { return std::numeric_limits::max() / sizeof(T); } - - pointer allocate(size_type num, const_void_pointer hint = 0) { return alloc_size(num*sizeof(T)); } - - static pointer alloc_size(size_type size) { - pointer ptr = NULL; - int __UNUSED result = posix_memalign((void**)&ptr, LT_SMP_CACHE_BYTES, size); - - return ptr; - } - - void construct (pointer p, const T& value) { new((void*)p)T(value); } - void destroy (pointer p) { p->~T(); } - void deallocate (pointer p, size_type num) { free((void*)p); } -}; - - -template -bool operator== (const cacheline_allocator&, const cacheline_allocator&) throw() { - return true; -} - -template -bool operator!= (const cacheline_allocator&, const cacheline_allocator&) throw() { - return false; -} - -} - -// -// Operator new with custom allocators: -// - -template -void* operator new(size_t s, rak::cacheline_allocator a) { return a.alloc_size(s); } - -#endif // namespace rak diff --git a/src/rpc/scgi_task.cc b/src/rpc/scgi_task.cc index c1d7b8a3..ee9b558f 100644 --- a/src/rpc/scgi_task.cc +++ b/src/rpc/scgi_task.cc @@ -2,7 +2,6 @@ #include "rpc/scgi_task.h" -#include #include #include #include