作者:傻傻的笑没心没肺wy | 来源:互联网 | 2023-05-17 10:14
writingmyownversionofmalloc()(andhisbestfriendMr.free()),IneedtoknowifIfreedmym
writing my own version of malloc() (and his best friend Mr. free()), I need to know if I free'd my memory correctly. Seems that I can't use valgrind because it checks for the libc'malloc, and mine is in a shared library loaded with LD_PRELOAD.
写我自己版本的malloc()(和他最好的朋友free先生())),我需要知道我是否正确地释放了我的内存。看来我不能使用valgrind,因为它检查libc'malloc,而我的则在一个装载了LD_PRELOAD的共享库中。
Currently if I use valgrind it says "0alloc 0free 0leak, everything is good", because it does not detect the allocations I did with MY malloc. (I use (s)brk() functions)
目前,如果我使用valgrind,它会说“0alloc 0free 0泄漏,一切都很好”,因为它没有检测到我用malloc做的分配。(我使用(s)brk()函数)
Does someone know if there's a way to check with valgrind anyways or with sth else ?
有人知道有什么方法可以和凡士林公司或其他公司进行核对吗?
Thanks !
谢谢!
1 个解决方案