I compile this code with Visual studio 2010 compiler:
#include "stdafx.h"
#include <iostream>
int main() {
int *p;
p = new int(255);
delete []p;
}
The disassembly of it, is different from Dev C++. It seems it first checks if there is enough memory and then start the allocation. am I right?
This is the disassembly :
In the Orange node:
Why esi
and edi
pushed to the stack?
I've seen mov eax,0CCCCCCCCh
before in books, What does this instruction do?
What does the highlighted part of the orange node do? Is it a check to see if there is enough available memory?
In the blue node:
FFh
is equal to 255
, Can you explain how the memory is getting allocated?