diff --git a/include/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp b/include/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp index 2c909ac..92947ea 100644 --- a/include/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp +++ b/include/boost/interprocess/mem_algo/detail/simple_seq_fit_impl.hpp @@ -146,7 +146,15 @@ class simple_seq_fit_impl #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) + template + T *allocation_command (boost::interprocess::allocation_type command, size_type limit_size, + size_type &prefer_in_recvd_out_size, T *&reuse); + + void * raw_allocation_command (boost::interprocess::allocation_type command, size_type limit_size, + size_type &prefer_in_recvd_out_size, void *&reuse_ptr, size_type sizeof_object = 1); + //!Multiple element allocation, same size + //!Experimental. Dont' use void allocate_many(size_type elem_bytes, size_type num_elements, multiallocation_chain &chain) { //----------------------- @@ -156,6 +164,7 @@ class simple_seq_fit_impl } //!Multiple element allocation, different size + //!Experimental. Dont' use void allocate_many(const size_type *elem_sizes, size_type n_elements, size_type sizeof_element, multiallocation_chain &chain) { //----------------------- @@ -165,6 +174,7 @@ class simple_seq_fit_impl } //!Multiple element deallocation + //!Experimental. Dont' use void deallocate_many(multiallocation_chain &chain); #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED @@ -194,13 +204,6 @@ class simple_seq_fit_impl //!This function is normally used for security reasons. void zero_free_memory(); - template - T *allocation_command (boost::interprocess::allocation_type command, size_type limit_size, - size_type &prefer_in_recvd_out_size, T *&reuse); - - void * raw_allocation_command (boost::interprocess::allocation_type command, size_type limit_size, - size_type &prefer_in_recvd_out_size, void *&reuse_ptr, size_type sizeof_object = 1); - //!Returns the size of the buffer previously allocated pointed by ptr size_type size(const void *ptr) const; diff --git a/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp b/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp index 4fca791..1d16fa4 100644 --- a/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp +++ b/include/boost/interprocess/mem_algo/rbtree_best_fit.hpp @@ -180,14 +180,19 @@ class rbtree_best_fit //Functions for single segment management - //!Allocates bytes, returns 0 if there is not more memory + //!Allocates bytes, returns 0 if there is not more memory. + //!Returned memory is aligned to Alignment bytes. void* allocate (size_type nbytes); + //!Deallocates previously allocated bytes + void deallocate(void* addr); + #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) //Experimental. Dont' use //!Multiple element allocation, same size + //!Experimental. Dont' use void allocate_many(size_type elem_bytes, size_type num_elements, multiallocation_chain &chain) { //----------------------- @@ -197,6 +202,7 @@ class rbtree_best_fit } //!Multiple element allocation, different size + //!Experimental. Dont' use void allocate_many(const size_type *elem_sizes, size_type n_elements, size_type sizeof_element, multiallocation_chain &chain) { //----------------------- @@ -206,12 +212,18 @@ class rbtree_best_fit } //!Multiple element allocation, different size + //!Experimental. Dont' use void deallocate_many(multiallocation_chain &chain); - #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED + template + T* allocation_command(boost::interprocess::allocation_type command, size_type limit_size, + size_type& prefer_in_recvd_out_size, T*& reuse); - //!Deallocates previously allocated bytes - void deallocate (void *addr); + void* raw_allocation_command(boost::interprocess::allocation_type command, size_type limit_object, + size_type& prefer_in_recvd_out_size, + void*& reuse_ptr, size_type sizeof_object = 1); + + #endif //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED //!Returns the size of the memory segment size_type get_size() const; @@ -237,14 +249,6 @@ class rbtree_best_fit //!and returns true if success bool check_sanity(); - template - T * allocation_command (boost::interprocess::allocation_type command, size_type limit_size, - size_type &prefer_in_recvd_out_size, T *&reuse); - - void * raw_allocation_command (boost::interprocess::allocation_type command, size_type limit_object, - size_type &prefer_in_recvd_out_size, - void *&reuse_ptr, size_type sizeof_object = 1); - //!Returns the size of the buffer previously allocated pointed by ptr size_type size(const void *ptr) const;