Re: "Move memory" in no time
- From: Alvin Beach <please_reply@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 24 Mar 2006 13:09:21 GMT
Johannes Singler wrote:
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
I think I understand what you are looking for. The API you are using states
it needs something at a particular memory location. This location is fixed
within the API and cannot be changed?
If this is the case, I would suggest writing a driver. This way the driver
will live in kernel space. Then you app would communicate with the driver
via some entry in /dev.
As far as I know, a user-space app cannot make abitrary decisions about the
physical (or virtual) memory locations. Only the kernel can do that.
However, perhaps someone better suited can correct me if I'm wrong.
Alvin
.
- Follow-Ups:
- Re: "Move memory" in no time
- From: Johannes Singler
- Re: "Move memory" in no time
- References:
- "Move memory" in no time
- From: Johannes Singler
- Re: "Move memory" in no time
- From: Jan Panteltje
- Re: "Move memory" in no time
- From: Johannes Singler
- "Move memory" in no time
- Prev by Date: Re: Application Security Options--USB Dongle?
- Next by Date: Re: "Move memory" in no time
- Previous by thread: Re: "Move memory" in no time
- Next by thread: Re: "Move memory" in no time
- Index(es):
Relevant Pages
|