testing if data is allocated on the stack or heap

drug drug2004 at bk.ru
Tue Oct 17 15:33:02 UTC 2017


My code fails and I guess the reason is I have a slice to data in the 
stack and it becomes garbage in some moment. So I need a way to check 
where data is placed. Is it right that it can be done in linux using 
`sbrk` so that if the addr of data is less than `sbrk(0)` returning then 
data is on the stack and on the heap in other case?


More information about the Digitalmars-d-learn mailing list