From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,NORMAL_HTTP_TO_IP autolearn=disabled version=3.1.3 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 51827BC6B for ; Thu, 13 Dec 2007 20:10:28 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah4FACoSYUfUnw7Vlmdsb2JhbACCOI1BAQEBAQcEBiIHmV8 X-IronPort-AV: E=Sophos;i="4.24,163,1196636400"; d="scan'208";a="5188407" Received: from ptb-relay02.plus.net ([212.159.14.213]) by mail2-smtp-roc.national.inria.fr with ESMTP; 13 Dec 2007 20:10:28 +0100 Received: from [80.229.56.224] (helo=beast.local) by ptb-relay02.plus.net with esmtp (Exim) id 1J2tR8-0000ML-VS; Thu, 13 Dec 2007 19:09:35 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr, dmitry grebeniuk Subject: Re: [Caml-list] announce: objsize-0.1 Date: Thu, 13 Dec 2007 13:11:56 +0000 User-Agent: KMail/1.9.5 References: <921352207.20071213105242@moldavcable.com> In-Reply-To: <921352207.20071213105242@moldavcable.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200712131311.57104.jon@ffconsultancy.com> X-Spam: no; 0.00; grebeniuk:01 ocaml:01 ocaml:01 hash:01 tarball:01 gcc:01 -wall:01 -pedantic:01 gcc:01 ocamlc:01 byterun:01 byterun:01 pointers:01 alloc:01 alloc:01 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 =E2=80=98%i=E2=80=99 expects type =E2=80=98= int=E2=80=99, but argument 2 has=20 type =E2=80=98long unsigned int=E2=80=99 =2E.. 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 =2E/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: =2E/ocamlsrc/byterun/config.h:51:2: error: #error "No integer type availabl= e to=20 represent pointers" In file included from bitarray.c:19, from c_objsize.c:11: alloc.c: In function =E2=80=98bitarrayalloc_realloc=E2=80=99: alloc.c:29: warning: format =E2=80=98%u=E2=80=99 expects type =E2=80=98unsi= gned int=E2=80=99, but argument 4=20 has type =E2=80=98size_t=E2=80=99 alloc.c:29: warning: format =E2=80=98%u=E2=80=99 expects type =E2=80=98unsi= gned int=E2=80=99, but argument 5=20 has type =E2=80=98long unsigned int=E2=80=99 alloc.c:29: warning: format =E2=80=98%u=E2=80=99 expects type =E2=80=98unsi= gned int=E2=80=99, but argument 6=20 has type =E2=80=98size_t=E2=80=99 In file included from c_objsize.c:13: ocamlsrc/byterun/misc.h: At top level: ocamlsrc/byterun/misc.h:96: error: expected =E2=80=98=3D=E2=80=99, =E2=80= =98,=E2=80=99, =E2=80=98;=E2=80=99, =E2=80=98asm=E2=80=99=20 or =E2=80=98__attribute__=E2=80=99 before =E2=80=98caml_verb_gc=E2=80=99 ocamlsrc/byterun/misc.h:97: error: expected declaration specifiers or =E2= =80=98...=E2=80=99=20 before =E2=80=98uintnat=E2=80=99 In file included from c_objsize.c:17: =2E.. =2D-=20 Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e