A different kind of Walter? :-)

Dan murpsoft at hotmail.com
Fri Apr 20 11:36:02 PDT 2007


Sean Kelly Wrote:
> Lionello Lunesu wrote:
> > I don't care if there address changes, just as long as there's no data being 
> > copied physically. I mean, a block of continuous memory might already be 
> > all-over-the-place in physical memory. That's what I want: a VirtualRealloc 
> > that returns the address of a new virtual memory block, but which is using 
> > the same physical memory.. 'Free' array resizes, surely this is worth 
> > something!
> 
> Hm, assuming there is nothing else of the page(s) but the data to move, 
> it should be possible to do so without explicit copying.  I have no idea 
> is VirtualAlloc can do this, but it's definitely possible.

Oh my!

On the x86, this sort of implementation would slaughter your performance, as you'd get massive numbers of cache and page misses.

You could theoretically implement a system on the x86 that would virtualize memory locations arbitrarily, but.... ewww...

I see two effective ways to realloc memory in a space too small for it:

1) move the data you are trying to reallocate to a larger space.

2) move the data that is confining it; which requires updating pointers and such to that data, which you can't realistically track on the x86.




More information about the Digitalmars-d mailing list