int i=4;
int *p = new int(17);
i = *p;
delete p;
p=0;
How to count how much memory is leaked? Is there like a unit to count this in?
int i=4;
int *p = new int(17);
i = *p;
delete p;
p=0;
How to count how much memory is leaked? Is there like a unit to count this in?
There's a lot of variables involved, such as how 'new' or malloc actually work so it's hard to quantify with exact figures. But since there's no garbage collection involved you can try a few things. One thing I've done before is wrap the suspect code in a tight loop and watch the memory growth.