Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete calls memset?

Why in call stack after delete this; the following function is being called?

msvcr110d.dll!_VEC_memset(void * dst, int val, int len) 

Please consider that operator delete is not overloaded.

like image 200
T M Avatar asked Dec 25 '22 22:12

T M


1 Answers

In debug version of the Microsoft C/C++ Runtime library, delete sets the freed memory to 0xDD using memset. That's why you see memset in the callstack. You won't see it in release version.
Likewise when memory is allocated through new, the newly allocated memory is set to 0xCD.

You can see some of the details here - https://msdn.microsoft.com/en-us/library/974tc9t1.aspx

like image 126
user93353 Avatar answered Jan 02 '23 18:01

user93353