I've been thinking and If do a ton of declarations like

//should be in the stack
int x,y,w,......


//should be in the heap
char *p = malloc(10*sizeof(int));
char *x = malloc(100*sizeof(int));
...


so all these guys will return an address, and I would simply find the min and max of the addresses

and if the variable falls into a min or max then it must be in that area of data, stack or heap


Does this sound good?