Answer the question
In order to leave comments, you need to log in
How does the program know if a piece of memory is occupied or free?
How does the program know if a piece of memory is occupied or free?
For example, in a C program, the malloc function allocates memory and returns a pointer to a piece of memory.
I mean a piece of memory in the address space of the program, and not the address on the physical memory module.
Answer the question
In order to leave comments, you need to log in
The program does not learn anything and should not, the OS allocates memory.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question