Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Caml-list] announce: objsize-0.1

0 views
Skip to first unread message

dmitry grebeniuk

unread,
Dec 13, 2007, 3:53:36 AM12/13/07
to caml...@yquem.inria.fr
Hello, caml-list.

Some time ago there was a discussion about measuring
sizes of ocaml values. I've got some "round tuits" and
released a library that I use in my programs for some
years. Maybe it will be useful for other people too.
It is better than pure ocaml solutions because it
doesn't build hash table of visited values, and it uses
two bits for each visited value in worst case (but in my
practice it used no more than 120kb of additional memory
when I measured sizes of 300Mb-values).

Readme: http://89.187.37.10/gds/objsize/README
Tarball: http://89.187.37.10/gds/objsize/objsize-0.1.tar.gz

--
WBR,
dmitry mailto:gds-...@moldavcable.com

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Jon Harrop

unread,
Dec 13, 2007, 2:10:44 PM12/13/07
to caml...@yquem.inria.fr, dmitry grebeniuk
On Thursday 13 December 2007 08:52, dmitry grebeniuk wrote:
> Hello, caml-list.
>
> Some time ago there was a discussion about measuring
> sizes of ocaml values. I've got some "round tuits" and
> released a library that I use in my programs for some
> years. Maybe it will be useful for other people too.
> It is better than pure ocaml solutions because it
> doesn't build hash table of visited values, and it uses
> two bits for each visited value in worst case (but in my
> practice it used no more than 120kb of additional memory
> when I measured sizes of 300Mb-values).
>
> Readme: http://89.187.37.10/gds/objsize/README
> Tarball: http://89.187.37.10/gds/objsize/objsize-0.1.tar.gz

This doesn't seem to work on 64-bit. First I get:

configure.c:24: warning: format ‘%i’ expects type ‘int’, but argument 2 has
type ‘long unsigned int’
..

Replacing %i with %ld in configure.c, this compiles but then I get:

$ make
gcc -ansi -W -Wall -Werror -Wno-long-long -pedantic \
-c configure.c -o configure.o
gcc configure.o -o configure.exe && \
rm -f configure.o
/configure.exe > ocamlsrc/config/m.h && \
rm -f configure.exe
ocamlc -c -I ./ocamlsrc/byterun c_objsize.c
In file included from bitarray.c:1,
from c_objsize.c:11:
/ocamlsrc/byterun/config.h:51:2: error: #error "No integer type available to
represent pointers"
In file included from bitarray.c:19,
from c_objsize.c:11:
alloc.c: In function ‘bitarrayalloc_realloc’:
alloc.c:29: warning: format ‘%u’ expects type ‘unsigned int’, but argument 4
has type ‘size_t’
alloc.c:29: warning: format ‘%u’ expects type ‘unsigned int’, but argument 5
has type ‘long unsigned int’
alloc.c:29: warning: format ‘%u’ expects type ‘unsigned int’, but argument 6
has type ‘size_t’
In file included from c_objsize.c:13:
ocamlsrc/byterun/misc.h: At top level:
ocamlsrc/byterun/misc.h:96: error: expected ‘=’, ‘,’, ‘;’, ‘asm’
or ‘__attribute__’ before ‘caml_verb_gc’
ocamlsrc/byterun/misc.h:97: error: expected declaration specifiers or ‘...’
before ‘uintnat’
In file included from c_objsize.c:17:
..

--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e

dmitry grebeniuk

unread,
Dec 14, 2007, 7:06:57 AM12/14/07
to caml...@yquem.inria.fr
Hello, Jon.

JH> This doesn't seem to work on 64-bit. First I get:

Thanks for testing, now it works on your platform too.

Readme: http://89.187.37.10/gds/objsize/README
Tarball: http://89.187.37.10/gds/objsize/objsize-0.11.tar.gz

--
WBR,
dmitry mailto:gds-...@moldavcable.com

_______________________________________________

0 new messages