Avoid 'eh vector constructor iterator'?

Is there any way avoiding 'eh vector constructor iterator' function created by the compiler for array of objects created with constructors and replacing it with inline version? Here is my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
class SYS_D3D_VDECL
{
public:
	SYS_D3D_VDECL();
	~SYS_D3D_VDECL();
	
	SYS_ERROR CreateVertexDecl(D3DVERTEXELEMENT9 * const, SYS_D3D_DEVICE *);
	void Clear();
	
	D3DVERTEXELEMENT9 * m_0;
	IDirect3DVertexDeclaration9 * m_4;
} ;

SYS_ERROR SYS_THREAD_POOL::Create(unsigned long (__cdecl *a0)(void *),void *a1,int a2)
{
	//Some code...
	m_48 = new SYS_D3D_VDECL[v40]; //Here the eh vector constructor iterator is called!
	//Some code...

}
This is very important for me! Please Replay!
From the infos I got, It's the destructor. You cannot remove it.
Last edited on
Can you explain more clearly please? Actually the new operator may not create an array of SYS_D3D_VDECL objects but it allocate size for them and call their constructors inline instead of 'eh vector constructor iterator'.
Try putting the 'inline' keyword before the constructor and destructor. Remember this is only a HINT. The compiler is not forced to make constructor/destructor inline.
This doesn't work for god sake ! Is there someway forcing the constructor to be inline or is there any way to define 'eh vector constructor iterator'? Please help!
EDIT: Oh anyway I found the solution:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
struct SYS_THREAD_POOL_DATA
{
	SYS_THREAD_POOL_DATA();
	class SYS_THREAD_POOL* m_0;
	DWORD m_4;
} ;
inline SYS_THREAD_POOL_DATA::SYS_THREAD_POOL_DATA() { (*(SYS_D3D_VDECL**)&m_0)->SYS_D3D_VDECL::SYS_D3D_VDECL(); }


SYS_ERROR SYS_THREAD_POOL::Create(unsigned long (__cdecl *a0)(void *),void *a1,int a2)
{
		Clear();
		DWORD ProcessAffinityMask;
		DWORD SystemAffinityMask;
		GetProcessAffinityMask(GetCurrentProcess(), &ProcessAffinityMask, &SystemAffinityMask);
		DWORD v4 = ProcessAffinityMask;
		DWORD v5 = 0;
		DWORD v40 = 0;
		if(v4) //Calculate Number Cores Used
		{
			do
			{
				v5 += (v4 & 1) == 1;
				v4 >>= 1;
			}
			while(v4);
			v40 = v5;
		} 
		DWORD v9 = 4 * v5;
		m_32 = new HANDLE[v5];
		memset(m_32, 0, 4 * (v9 / 4));
		if((v9 % 4) != 0)
			memset(&m_32[4 * (v9 / 4)], 0, 3);
		m_48 = new SYS_THREAD_POOL_DATA[v40];
		m_36 = new HANDLE[v9];
		memset(m_36, 0, 4 * (v9 / 4));
		if((v9 % 4) != 0)
			memset(&m_36[v9 / 4], 0, 3);
		m_60 = a0;
		m_64 = a1;
	try {
		m_40 = CreateEventA(0, 1, 1, 0);
		if(!m_40)
			throw SYS_ERROR_THREAD;
		m_44 = CreateEventA(0, 1, 0, 0);
		if(!m_44)
			throw SYS_ERROR_THREAD;
		DWORD v21 = ProcessAffinityMask;
		for(int i = 0; v21; v21 /= 2, --i)
		{
			HANDLE & v_14 = m_32[m_24];
			m_48[m_24].m_4 = m_24;
			m_48[m_24].m_0 = this;
			++m_24;
			m_36[m_24] = CreateEventA(NULL, true, false, NULL);
			if(!m_36[m_24])
				throw SYS_ERROR_THREAD;
			unsigned int ThreadId;
			v_14 = (HANDLE)_beginthreadex(0, 0, (unsigned int (__stdcall *)(void*))&ThreadProc, (void*)&m_48[m_24], 4u, &ThreadId);
			if(!v_14)
				throw SYS_ERROR_THREAD;
			if(!SetThreadPriority(v_14, a2))
				throw SYS_ERROR_THREAD;
			ResumeThread(v_14);
		}
	}
	catch(SYS_ERROR tmp)
	{
		Clear();
		return tmp;
	}
	return SYS_ERROR_NO;
}
Last edited on
Topic archived. No new replies allowed.