Sorry for disturbing you, again...
Does it means we should also free virtual memory from the child process before exiting ?
Does it means we should also free virtual memory from the child process before exiting ?
On 2024-09-22T10:27:56.000+02:00, Otto Moerbeek <otto@drijf.net> wrote:
On Sun, Sep 22, 2024 at 10:08:56AM +0200, bilal@iscarioth.org wrote:Hello OpenBSD teamI'm having a little trouble understanding how this works.of fork(2), according to man. It's an exact copy of the parentprocess.There are limitations that are explicit in the man. However,I wanted to know if the pointers we use are the same.For example, if I had allocated 4 bytes in my parent process, I wouldlaunch the fork...If I release this address from the child, is the father's pointerstill intact, or is it released?Translated with DeepL.com (free version)It's an exact copy, all memory allocations remain the same. The trickis the new process virtual memory space is seperate, so the equalpointer actually refer to different sets of memory (each process hasit's onwn virual memory space). So an allocatoon or free done by theparent or child does not interfere with the other process.-Otto
No comments:
Post a Comment