Hello, I need some help if anyone has an idea. I'm working a memory management simulator trying to implement a mark & compact algorithm. To do that I need a function that can move/copy a block of memory from address A to address B. I tried using
memmove (dst, src, size)
but what ever I try I keep getting a Segmentation fault.
The simulator(which acts somewhat like a interpreter) asks the OS(Linux) for a block of memory to work with, and within that memory it allocates chunks of memory which can be worked with, as well as giving me a pointer to the usable space within the chunk.
-I know the *dst pointer points to a safe address
-the only way to access the memory location where I need to write is by the *dst pointer
-basicly all I have to work with is the src and dst address, that is the pointers A and B
In short, does anyone have an idea how to move a block of memory from pointer A to pointer B without running into a Segmentation fault?
-or is there maybe some way to tell my OS I want to write whatever I want, where ever I want... any input is welcome, maybe I'm just doing something wrong, thx in advance