Re: "Move memory" in no time



Jan Panteltje wrote:

For API compatibility, I need to move a large block of data to another
place in memory. I really need to only _move_ it, I don't need the
original data any more. So far I call memcpy and free up the original
space afterwards. Now I was wondering if there is a kernel call that
achieves this by just changing some page table entries. In this case, no
transfer would be necessary and the move should be much faster.

Is this possible? Can we maybe abuse some mmap-related calls for that?

I do not get it, say you have allocated that space with malloc, now you
have a pointer to it.
When you want to 'move' it means something else should get in the place of
the space used by that pointer.
Then leave that space and let the 'something else' use a different space?

But 'something else' assumes that the input data has been transformed
in-place, i. e. the output has to reside at that specific location in
memory. This is a fixed API postcondition which I cannot change.
Any ideas anyway?

Bye,
Johannes
.



Relevant Pages

  • Re: "Move memory" in no time
    ... For API compatibility, I need to move a large block of data to another ... place in memory. ... original data any more. ... the space used by that pointer. ...
    (comp.os.linux.development.apps)
  • Re: Is this a valid memory address?
    ... Now granted, lParam could be garbage, it could be the sum of stuff, ... or it "could be a pointer to some memory". ... What I'd like to do is memcpy it's contents, ... Even if it is a pointer, ...
    (microsoft.public.vc.language)
  • Re: Best way to copy the content from a const u_char* to a BYTE*
    ... mikkel rev wrote: ... See memcpy() ... Of course this only works if it is ok for you to point to the original data with the pointer for whatever you need it. ...
    (comp.programming)
  • Re: Is this math test too easy?
    ... > communications glitch; one of the more laughable cartoons ... it was loaded into physical memory and, ... > Or one can interpret the character string as one of the values ... A pointer to an integer? ...
    (sci.math)
  • Re: grow list by tail, pointer example recipe -- please comment
    ... manufacturing a pointer with that address. ... the next cons cell. ... believe these lists are in consecutive memory locations. ...
    (comp.lang.lisp)