Checking if something was malloced

后端 未结 8 761
面向向阳花
面向向阳花 2021-01-12 07:06

Given a pointer to some variable.. is there a way to check whether it was statically or dynamically allocated??

8条回答
  •  佛祖请我去吃肉
    2021-01-12 07:31

    The ACE library does this all over the place. You may be able to check how they do it. In general you probably shouldn't need to do this in the first place though...

提交回复
热议问题