|
Boost : |
Subject: Re: [boost] [GIL] Can image::recreate reuse the memory?
From: TONGARI (tongari95_at_[hidden])
Date: 2013-04-24 22:44:29
2013/4/25 Christian Henning <chhenning_at_[hidden]>
> >
> > On Sun, Apr 14, 2013 at 7:15 PM, Christian Henning <chhenning_at_[hidden]
> >wrote:
> >
> >>
> >> Well, after a deeper look, some ctors need _align_in_bytes from another
> >>> image... if you don't care an extra data member, it's still doable.
> >>>
> >>> Or maybe I should cook me own :(
> >>>
> >>>
> >>
> I have added a fix to reuse memory when an image is smaller than the older
> one. Would you mind having a look and give me some feedback?
>
Unfortunately I think this is buggy for deallocate.
Since _view's dimensions are changed after recreated, you can't get the
original capacity from the changed dimensions.
Capacity must be kept to make deallocate right.
BTW, I've made my own image type which accepts align as a template param
instead.
Thanks
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk