$search
00001 // 00002 // handler_alloc_hook.hpp 00003 // ~~~~~~~~~~~~~~~~~~~~~~ 00004 // 00005 // Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) 00006 // 00007 // Distributed under the Boost Software License, Version 1.0. (See accompanying 00008 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 00009 // 00010 00011 #ifndef ASIO_HANDLER_ALLOC_HOOK_HPP 00012 #define ASIO_HANDLER_ALLOC_HOOK_HPP 00013 00014 #if defined(_MSC_VER) && (_MSC_VER >= 1200) 00015 # pragma once 00016 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) 00017 00018 #include "asio/detail/push_options.hpp" 00019 00020 #include "asio/detail/push_options.hpp" 00021 #include <cstddef> 00022 #include <boost/config.hpp> 00023 #include "asio/detail/pop_options.hpp" 00024 00025 namespace asio { 00026 00028 00061 inline void* asio_handler_allocate(std::size_t size, ...) 00062 { 00063 return ::operator new(size); 00064 } 00065 00067 00078 inline void asio_handler_deallocate(void* pointer, std::size_t size, ...) 00079 { 00080 (void)(size); 00081 ::operator delete(pointer); 00082 } 00083 00084 } // namespace asio 00085 00086 #include "asio/detail/pop_options.hpp" 00087 00088 #endif // ASIO_HANDLER_ALLOC_HOOK_HPP