I
Ian Lazarus
Hello,
I tried to confirm that two different heap allocation calls were being made,
i.e., one for __gc and one for __nogc. However, the addresses of the calls
(as seen in disassembly) are not what I expected. As you can see the four
calls in tmain are all to the same routine, while the one in the class
constructor is different. Does anybody know what's going on here?
Thanks
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
__value class VClass
{
public:
VClass()
: p(new int(0)) // call F9BB56E3
{ }
int* p;
};
int _tmain()
{
int* p1 = new int(0); // call dword ptr ds:[00965A00h]
int __nogc* p2 = __nogc new int(0); // call dword ptr ds:[00965A00h]
Int32* p3 = new Int32(0); // call dword ptr ds:[00965A00h]
Int32 __gc* p4 = new Int32(0); // call dword ptr ds:[00965A00h]
VClass v;
return 0;
}
I tried to confirm that two different heap allocation calls were being made,
i.e., one for __gc and one for __nogc. However, the addresses of the calls
(as seen in disassembly) are not what I expected. As you can see the four
calls in tmain are all to the same routine, while the one in the class
constructor is different. Does anybody know what's going on here?
Thanks
#include "stdafx.h"
#using <mscorlib.dll>
using namespace System;
__value class VClass
{
public:
VClass()
: p(new int(0)) // call F9BB56E3
{ }
int* p;
};
int _tmain()
{
int* p1 = new int(0); // call dword ptr ds:[00965A00h]
int __nogc* p2 = __nogc new int(0); // call dword ptr ds:[00965A00h]
Int32* p3 = new Int32(0); // call dword ptr ds:[00965A00h]
Int32 __gc* p4 = new Int32(0); // call dword ptr ds:[00965A00h]
VClass v;
return 0;
}