Closed GoogleCodeExporter closed 9 years ago
Original comment by dwhall...@gmail.com
on 20 Apr 2009 at 4:52
Created a sizeof module. On the desktop the results are
{{{
ipm> import sizeof
ipm> sizeof.print_sizes()
sizeof(NON) = 2
sizeof(INT) = 8
sizeof(FLT) = 8
sizeof(STR) = 12
sizeof(TUP) = 8
sizeof(COB) = 24
sizeof(MOD) = 20
sizeof(CLO) = 8
sizeof(FXN) = 20
sizeof(CLI) = 8
sizeof(CIM) = 0
sizeof(NIM) = 0
sizeof(NOB) = 24
sizeof(THR) = 12
sizeof(EXN) = 8
sizeof(BOL) = 8
sizeof(CIO) = 4
sizeof(LST) = 8
sizeof(DIC) = 12
sizeof(FRM) = 44
sizeof(BLK) = 20
sizeof(SEG) = 40
sizeof(SGL) = 16
sizeof(SQI) = 12
sizeof(NFM) = 52
ipm> sizeof.sizeof(42)
12
ipm> sizeof.sizeof(-1)
12
ipm> sizeof.sizeof(-2)
20
}}}
Notice that sizeof.print_sizes() prints the actual sizes of the structs that
contain
the types, but sizeof.sizeof(obj) prints the size of the chunk allocated to
hold the
given obj, which may vary.
Original comment by dwhall...@gmail.com
on 20 Apr 2009 at 6:48
Relocated #ifdef HAVE_FLOAT in float.h so that the PmFloat_t type was always
available.
The sizeof module is NOT included in the vm build by default, you must edit
src/vm/Makefile to add it to PMSTDLIB_SOURCES.
System tests pass. Mainlined directly, see r351
Original comment by dwhall...@gmail.com
on 20 Apr 2009 at 6:53
Changed r08 to R08
Original comment by dwhall...@gmail.com
on 12 Mar 2010 at 8:22
Original comment by dwhall...@gmail.com
on 13 Mar 2010 at 1:30
Original issue reported on code.google.com by
dwhall...@gmail.com
on 16 Apr 2009 at 7:06