Memory Allocation for a Pointer

i debugged the program in two terminals, providing different input data, but in particular, I saw it in one terminal

ins (ptr=0x0, key=1, upKey=0xbffff308, newnode=0xbffff30c)

and in another terminal

ins (ptr=0x0, key=1, upKey=0xbffff308, newnode=0xbffff30c)

where is the ins function

ins(struct node *ptr, int key, int *upKey,struct node **newnode)

how to assign the same memory location to a pointer. and I run the same program on two different terminals ... with different inputs

+5
source share
3 answers

, , , . , , , ( ) , ( ). , , , - , , , . , A , .

+5

, , . . . , (4 32- , 64- ). , , . ; - .

+9

Besides those that were addressed as virtual and "private" for each process, remember that some physical memory can actually be shared between processes. For example, when you fork()do not immediately completely copy the process, the code remains open, and the data pages are only copied when you try to change them ("copy when writing"), so the two programs can share physical memory (transparent to them).

+1
source

All Articles