Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
announce: objsize-0.1
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-12-13 (19:10)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] announce: objsize-0.1
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:
> Tarball:

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.