I have a trivial class containing only an Int. Depending on whether I add an explicit destructor or not, I don't get the same memory leak size in Valgrind. Why is that ?
class Test {
public:
// ~Test() {}
int x;
};
int main(){
Test* t = new Test[0];
}
Since I create an array of 0 object, I expect to get 0 bytes of leak in Valgrind. I get this answer with the above code. However, when I uncomment the line with the explicit destructor, valgrind gives me 8 bytes of leak.