From 12cf076118570eebbff08c6b3090e0d4798447a1 Mon Sep 17 00:00:00 2001 From: cyfraeviolae Date: Wed, 3 Apr 2024 03:17:55 -0400 Subject: no venv --- .../site-packages/greenlet/greenlet_allocator.hpp | 63 ---------------------- 1 file changed, 63 deletions(-) delete mode 100644 venv/lib/python3.11/site-packages/greenlet/greenlet_allocator.hpp (limited to 'venv/lib/python3.11/site-packages/greenlet/greenlet_allocator.hpp') diff --git a/venv/lib/python3.11/site-packages/greenlet/greenlet_allocator.hpp b/venv/lib/python3.11/site-packages/greenlet/greenlet_allocator.hpp deleted file mode 100644 index b452f54..0000000 --- a/venv/lib/python3.11/site-packages/greenlet/greenlet_allocator.hpp +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef GREENLET_ALLOCATOR_HPP -#define GREENLET_ALLOCATOR_HPP - -#define PY_SSIZE_T_CLEAN -#include -#include -#include "greenlet_compiler_compat.hpp" - - -namespace greenlet -{ - // This allocator is stateless; all instances are identical. - // It can *ONLY* be used when we're sure we're holding the GIL - // (Python's allocators require the GIL). - template - struct PythonAllocator : public std::allocator { - - PythonAllocator(const PythonAllocator& UNUSED(other)) - : std::allocator() - { - } - - PythonAllocator(const std::allocator other) - : std::allocator(other) - {} - - template - PythonAllocator(const std::allocator& other) - : std::allocator(other) - { - } - - PythonAllocator() : std::allocator() {} - - T* allocate(size_t number_objects, const void* UNUSED(hint)=0) - { - void* p; - if (number_objects == 1) - p = PyObject_Malloc(sizeof(T)); - else - p = PyMem_Malloc(sizeof(T) * number_objects); - return static_cast(p); - } - - void deallocate(T* t, size_t n) - { - void* p = t; - if (n == 1) { - PyObject_Free(p); - } - else - PyMem_Free(p); - } - // This member is deprecated in C++17 and removed in C++20 - template< class U > - struct rebind { - typedef PythonAllocator other; - }; - - }; -} - -#endif -- cgit v1.2.3