spurious gc allocation

bearophile bearophileHUGS at lycos.com
Sat Nov 9 03:04:13 PST 2013


Ellery Newcomer:

> can anyone confirm?

I only see the class instance allocation in the main(). I use two 
modules, with your code. I compile on Windows 32, using no 
compilation flags, and I see this asm, with obj2asm:


_D1a1C13_InsertAllButMFiZv:
		push	EAX
		push	EAX
		mov	[ESP],0
		add	ESP,8
		ret	4

__Dmain:
L0:     mov EAX,offset FLAT:_D1a1C7__ClassZ
         push    EAX
         call    near ptr __d_newclass
         push    1
         mov ECX,[EAX]
         call    dword ptr 014h[ECX]
         xor EAX,EAX
         add ESP,4
         ret

_main:
L0:     mov EAX,offset FLAT:__Dmain
         push    EAX
         push    dword ptr 0Ch[ESP]
         push    dword ptr 0Ch[ESP]
         call    near ptr __d_run_main
         add ESP,0Ch
         ret

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list