From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p61CsXkv001702 for ; Fri, 1 Jul 2011 14:54:38 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuwBAJ3CDU7RVdg2kGdsb2JhbAA8AQMSp1gIFAEBAQEJCQ0HFAQhrFSMJIJLhDw5iGgCAwaGLASHOIp6jB48g1w X-IronPort-AV: E=Sophos;i="4.65,458,1304287200"; d="scan'208";a="97801543" Received: from mail-qw0-f54.google.com ([209.85.216.54]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 Jul 2011 14:54:37 +0200 Received: by qwc9 with SMTP id 9so2776558qwc.27 for ; Fri, 01 Jul 2011 05:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Yl3/+RgenFyMCQ80P22kEWma6cs4y1ysf66i4rD0Roc=; b=ZSrw0JwX3EzEryWb36rYPHbnQob2STXJiNTvmr7hd55cUcEyGC/ZMJm7shma2FOWlP L4x72tVJMNVkBs8iAoTamSOYEfYNyRPqsGD+eWq67eK6Fzsqjm/aqEOkEfLEaKmaHtb2 QT4ASJ1kjEIjdXxeFxFQ0jVbMXiznzQK2//Xg= MIME-Version: 1.0 Received: by 10.229.99.145 with SMTP id u17mr2460322qcn.236.1309524876622; Fri, 01 Jul 2011 05:54:36 -0700 (PDT) Received: by 10.229.249.206 with HTTP; Fri, 1 Jul 2011 05:54:36 -0700 (PDT) In-Reply-To: <4E0DB5DE.8090309@inria.fr> References: <4E0DB5DE.8090309@inria.fr> Date: Fri, 1 Jul 2011 16:54:36 +0400 Message-ID: From: Dmitry Bely To: Fabrice Le Fessant Cc: caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] GC interface question On Fri, Jul 1, 2011 at 3:56 PM, Fabrice Le Fessant wrote: > I would not call camlidl_alloc_small() without first initializing > correctly _varg[1] to Val_unit. Actually, it's initialized to zero. The full generated fragment: HRESULT STDMETHODCALLTYPE camlidl_ppm_IConfigLoad_setLogger_callback( struct IConfigLoad * this, /* in */ void *log) { value _varg[2] = { 0, 0, }; value _vres; HRESULT _res; (*camlidl_acquire_runtime)(); Begin_roots_block(_varg, 2) _varg[0] = ((struct camlidl_intf *) this)->caml_object; _varg[1] = camlidl_alloc_small(1, Abstract_tag); Field(_varg[1], 0) = (value) log; End_roots() _vres = caml_callbackN_exn(caml_get_public_method(_varg[0], Val_int(1007700946)), 2, _varg); if (Is_exception_result(_vres)) { _res = camlidl_result_exception(NULL, Extract_exception(_vres)); } else { _res = S_OK; } (*camlidl_release_runtime)(); return _res; } It was Xavier Leroy who initially decided to use zeroes, so I think it's OK? - Dmitry Bely