Re: "Move memory" in no time



On a sunny day (Thu, 23 Mar 2006 09:49:40 +0100) it happened Johannes Singler
<singler@xxxxxxxxxx> wrote in <dvtnf5$4bn$1@xxxxxxxxxxxxxxxxxxxxxxxxx>:

Hi there!

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?

Thanks,
Johannes
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?

.



Relevant Pages

  • Re: "Move memory" in no time
    ... place in memory. ... original data any more. ... So far I call memcpy and free up the original ... the space used by that pointer. ...
    (comp.os.linux.development.apps)
  • "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. ... Can we maybe abuse some mmap-related calls for that? ...
    (comp.os.linux.development.apps)
  • 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)
  • 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: some unanswered questions on C
    ... A pointer variable that's never been given a value. ... you don't know what memory you're modifying. ... >what i want to ask is that when i declare my buffer for fgets as ... "char *buffer" creates a pointer, ...
    (comp.unix.programmer)