tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Moving memory in VM?



mremap? Or what am I missing?

  Johnny

On 2024-07-19 18:41, Mouse wrote:
Is there any way to move memory within a process?  That is, I have a
bunch of valid pages at addresses [A..B) and I want to move those pages
to [C..C+(B-A)).

The principal use case I have at the moment has the initial mapping
mapped MAP_ANON, with C fixed and mmap()-style semantics for anything
that was in the target range to start with.  It's OK if the [A..B)
range is unmapped in the process, and it's OK to requires that the old
and new address ranges not overlap.  (I'm trying to implement an
alternative memory allocator and want realloc() for multi-page blocks
to be faster than copying all the bytes.)

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
  X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index