I noticed that if I give MY_STRUCT a simple c'tor and d'tor, say,
MY_STRUCT::MY_S TRUCT()
{
hEvent = CreateEvent(... );
}
MY_STRUCT::~MY_ STRUCT
{
CloseHandle(hEv ent);
}
then using a local instance via simple declaration,
INT my_function()
{
MY_STRUCT foo;
// blah
return 0;
}
adds nearly 6KB (most in the .text segment) to my target DLL when compared to
using it via new/delete. Can someone explain why that happens? The example
above is just a little simplified. The actual struct has as members a HANDLE, a
BOOL, and an OVERLAPPED but still the only initialization I want is for the
HANDLE. Thanks!
--
- Vince
MY_STRUCT::MY_S TRUCT()
{
hEvent = CreateEvent(... );
}
MY_STRUCT::~MY_ STRUCT
{
CloseHandle(hEv ent);
}
then using a local instance via simple declaration,
INT my_function()
{
MY_STRUCT foo;
// blah
return 0;
}
adds nearly 6KB (most in the .text segment) to my target DLL when compared to
using it via new/delete. Can someone explain why that happens? The example
above is just a little simplified. The actual struct has as members a HANDLE, a
BOOL, and an OVERLAPPED but still the only initialization I want is for the
HANDLE. Thanks!
--
- Vince
Comment