Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84048 - trunk/boost/gil
From: chhenning_at_[hidden]
Date: 2013-04-25 10:48:25


Author: chhenning
Date: 2013-04-25 10:48:24 EDT (Thu, 25 Apr 2013)
New Revision: 84048
URL: http://svn.boost.org/trac/boost/changeset/84048

Log:
reverted back fix to reuse memory.
Text files modified:
   trunk/boost/gil/image.hpp | 30 +++---------------------------
   1 files changed, 3 insertions(+), 27 deletions(-)

Modified: trunk/boost/gil/image.hpp
==============================================================================
--- trunk/boost/gil/image.hpp (original)
+++ trunk/boost/gil/image.hpp 2013-04-25 10:48:24 EDT (Thu, 25 Apr 2013)
@@ -145,33 +145,9 @@
         swap(_alloc, img._alloc);
     }
 
- void recreate(const point_t& dims, std::size_t alignment=0, const Alloc alloc_in = Alloc())
- {
- if( dims == _view.dimensions() && _align_in_bytes == alignment )
- {
- return;
- }
-
- std::size_t old_size = total_allocated_size_in_bytes( _view.dimensions() );
- std::size_t new_size = total_allocated_size_in_bytes( dims );
-
- if( old_size >= new_size )
- {
- destruct_pixels( _view );
-
- _view = view_t( dims
- , typename view_t::locator( typename view_t::x_iterator( _memory )
- , get_row_size_in_memunits( dims.x )
- )
- );
-
- default_construct_pixels( _view );
- }
- else
- {
- image tmp(dims, alignment, alloc_in);
- swap(tmp);
- }
+ void recreate(const point_t& dims, std::size_t alignment=0, const Alloc alloc_in = Alloc()) {
+ image tmp(dims, alignment, alloc_in);
+ swap(tmp);
     }
 
     void recreate(x_coord_t width, y_coord_t height, std::size_t alignment=0, const Alloc alloc_in = Alloc()) {


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk