4 ms·
1. assert the integer's post condition. works best if the integer is filled with an uninitialized pattern first. 2. something like CRT or dmalloc to catch the
by sesuximo 7y ago
1. assert the integer's post condition. works best if the integer is filled with an uninitialized pattern first.
2. something like CRT or dmalloc to catch the leak. not perfect but a good hint
- monocasa 7y agoThe integer was set correctly, so it wouldn't have triggered an assertation. And valgrind didn't find the leak, so dlmalloc or CRT def would not have.
- ksherlock 7y agoSo you would call thirdparty_process("whatever", &res); then assert that res == 1? On little endian architectures, it is 1. On big endian architectures, it's 0 which seems like a reasonable value as well.
- sesuximo 7y agodepends on context, but you could either assert a range of possible values or assert not dead