It is important to keep in mind that addresses that are 0x0, 0x1, 0x2, etc. are not stack’d, malloc’d or (recently) free’d, so it is important to consider this when trying to determine if a memory address is stack’d or not.
The problem is that c addresses 0x0 are all heap and thus stackd. This is not true for 0x1, 0x2, 0x3, 0x4, etc. addresses. So you should really try to avoid reading from them if possible.
So if a 0x0 address is stackd, malloced or recently freed, it is still stackd, malloced or recently freed because it hasn’t moved out of the heap. However, if a 0x0 address is not stackd, mallocd or recently freed, it is not stackd, mallocd or recently freed because it has moved out of the heap and so it is now stackd, malloced or recently freed.
It’s a bit of a shame we don’t have a good reason to get into it. As a result, we don’t know when we’ll get into it, and we do have to keep in mind that if we need to make some changes to our code, we should at least make some modifications. This is especially true if we are a development team. If we need to change something, we need to make sure it has been put out there.
If we need to change something, we need to make sure it has been put out there. So we have to do it for the next time we are asked for help, or else we are going to waste our programming time.
And we don’t have to worry about getting in trouble for doing it, as it is done for our benefit. If we need to modify the way we handle variables, we can always use new (possibly unsafe) pointers to avoid the compiler getting in our way. However, if we change the way we handle memory, we may be in trouble.
In C, we are allowed to change the way we access variables in two ways. We can allocate memory and then use malloc() or call new()to get an allocated memory block. Or we could make a variable that is never used and free it when it is no longer used. The difference is the first means it is stack’d, malloc’d or (recently) free’d.
The second definition, mallocd, is a good thing. It does not allow a variable to be overwritten so it has a constant address. However, as you can see in the first definition, with malloc d we can never free the memory that was allocated. That’s a problem because the compiler cannot know which variables were allocated and which ones were not.
So when you have a variable that is never used you can’t free it. However, it is not stack-d, malloc’d or (recently) free’d. If you define a variable as stackd, malloc’d or (recently) free’d, the compiler will know that it has a constant address. But this is not a problem. The compiler may not know the addresses of all variables because they may be stored in different locations on the stack.