Subject: Re: [geometry] 1.57 Storing indices as values to save space.
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2014-11-26 14:49:27
Tim Finer wrote:
> Hi Adam,
> Actually, I think what rtree is doing with the temporary vector in the
> packing constructor should be considered a bug.
> That problem is that the vector is created without regard to the
> rtree's allocator - so even if a user gives the rtree a memory mapped
> file allocator, the rtree creates a copy of the incoming data in
> memory, ignoring the allocator.
Not really a copy of incoming data. A calculated centroids and iterators
to the original data.
Yes, rtree's allocator could be passed to the vector (as mentioned in
the other email). Then iterators shouldn't be stored since they might be
not suitable for storing in shared memory. So probably a copy of actual
objects should be made here. And this could be done only if an allocator
was different than std::allocator<> so at least in this case it wouldn't
harm the performance. Also in the case of passing RandomAccessIterators
elements indexes could be stored instead of iterators.
But would it solve your problem?
Alterntively a second allocator could be passed for this temporary
container, so a second, temporary file could be used. This would
probably be the most convenient for you, am I right? However this would
require to complicate the interface (constructors) so I don't like it.
We should definietly think about it when implementing a "proper"
Geometry list run by mateusz at loskot.net