One Hat Cyber Team
Your IP :
216.73.216.140
Server IP :
162.240.179.46
Server :
Linux vps-14493116.nutrivittasaude.com.br 5.14.0-687.17.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jun 22 07:21:26 EDT 2026 x86_64
Server Software :
Apache
PHP Version :
8.2.31
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
include
/
boost
/
coroutine
/
View File Name :
standard_stack_allocator.hpp
// Copyright Oliver Kowalke 2009. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_COROUTINES_STANDARD_STACK_ALLOCATOR_H #define BOOST_COROUTINES_STANDARD_STACK_ALLOCATOR_H #if defined(BOOST_USE_VALGRIND) #include <valgrind/valgrind.h> #endif #include <cstddef> #include <cstdlib> #include <new> #include <boost/assert.hpp> #include <boost/config.hpp> #include <boost/coroutine/detail/config.hpp> #include <boost/coroutine/stack_context.hpp> #include <boost/coroutine/stack_traits.hpp> #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif namespace boost { namespace coroutines { template< typename traitsT > struct basic_standard_stack_allocator { typedef traitsT traits_type; void allocate( stack_context & ctx, std::size_t size = traits_type::minimum_size() ) { BOOST_ASSERT( traits_type::minimum_size() <= size); BOOST_ASSERT( traits_type::is_unbounded() || ( traits_type::maximum_size() >= size) ); void * limit = std::malloc( size); if ( ! limit) throw std::bad_alloc(); ctx.size = size; ctx.sp = static_cast< char * >( limit) + ctx.size; #if defined(BOOST_USE_VALGRIND) ctx.valgrind_stack_id = VALGRIND_STACK_REGISTER( ctx.sp, limit); #endif } void deallocate( stack_context & ctx) { BOOST_ASSERT( ctx.sp); BOOST_ASSERT( traits_type::minimum_size() <= ctx.size); BOOST_ASSERT( traits_type::is_unbounded() || ( traits_type::maximum_size() >= ctx.size) ); #if defined(BOOST_USE_VALGRIND) VALGRIND_STACK_DEREGISTER( ctx.valgrind_stack_id); #endif void * limit = static_cast< char * >( ctx.sp) - ctx.size; std::free( limit); } }; typedef basic_standard_stack_allocator< stack_traits > standard_stack_allocator; }} #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif #endif // BOOST_COROUTINES_STANDARD_STACK_ALLOCATOR_H