← Back to index
|
Original Bugzilla link
Bug 1141 – <Class>.classinfo.init.length does not give instance size on linux
Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2007-04-13T09:29:00Z
Last change time
2014-02-16T15:22:23Z
Assigned to
bugzilla
Creator
benoit
Comments
Comment #0
by benoit — 2007-04-13T09:29:29Z
While this seems to work on windows, on linux it doesn't. module t; extern (C) int printf( char*, ... ); class A1{ int a; int b; int[3] c; int d; static void print(){ printf( "%d %d %d %d %d\n", a.offsetof, b.offsetof, c.offsetof, d.offsetof, A1.classinfo.init.sizeof); } } class A2{ int a; int[3] b; int c; int d; static void print(){ printf( "%d %d %d %d %d\n", a.offsetof, b.offsetof, c.offsetof, d.offsetof, A2.classinfo.init.sizeof); } } void main(){ A1.print; A2.print; } frank@lingurke:~$ dmd t gcc t.o -o t -m32 -lphobos -lpthread -lm frank@lingurke:~$ ./t 8 12 16 28 8 8 12 24 28 8
Comment #1
by benoit — 2007-04-13T17:56:23Z
Like lionello said, this should be .length not .sizeof :/