From mboxrd@z Thu Jan 1 00:00:00 1970 X-Sympa-To: caml-list@inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p61Db6iF004053 for ; Fri, 1 Jul 2011 15:37:06 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsQGADnMDU5KfVK2kGdsb2JhbAA8AQMShEKULoNIiyMIFAEBAQEJCQ0HFAQhiHujRYtmgwmEP4khAgMGhSCBDASNTIRmhHaBHIYMPIE9ghw X-IronPort-AV: E=Sophos;i="4.65,458,1304287200"; d="vcf'?scan'208";a="112339478" Received: from mail-wy0-f182.google.com ([74.125.82.182]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 Jul 2011 15:37:00 +0200 Received: by wyg24 with SMTP id 24so4023210wyg.27 for ; Fri, 01 Jul 2011 06:37:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; bh=qNTiRJO1h5o2SIswKrhuoTfPr163FcPrAzxWItb+CSY=; b=Zux6Kd6h6ox4tl8kK/N14fbkL15Xj7jYWRX/BGBsSJFp8T+1uiKdBQrhGINfP0Lqaw 3JubPROHBU68TFlX7EfZPDHVKAmnrjZ6CDwJq9DfE9Dzgu6M94M2Raxih4e3bdOkxjzt oWQtG7RqqpXsm7qxx00Zl7D9o3yK8U/HBnOu4= Received: by 10.227.11.143 with SMTP id t15mr2966948wbt.56.1309527420601; Fri, 01 Jul 2011 06:37:00 -0700 (PDT) Received: from [195.83.212.239] (chercheurs-239.saclay.inria.fr [195.83.212.239]) by mx.google.com with ESMTPS id fu18sm2366304wbb.10.2011.07.01.06.36.58 (version=SSLv3 cipher=OTHER); Fri, 01 Jul 2011 06:36:59 -0700 (PDT) Sender: Fabrice Le Fessant Message-ID: <4E0DCD7C.5010907@inria.fr> Date: Fri, 01 Jul 2011 15:37:00 +0200 From: Fabrice Le Fessant User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: caml-list@inria.fr References: <4E0DB5DE.8090309@inria.fr> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: multipart/mixed; boundary="------------050205080400070908000202" X-Validation-by: fabrice.le_fessant@inria.fr Subject: Re: [Caml-list] GC interface question This is a multi-part message in MIME format. --------------050205080400070908000202 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Initialization to 0 for _varg is OK, of course. What does camlidl_acquire_runtime do ? I couldn't find it in camlidl sources. Is-it possible it could trigger some garbage collection ? Is the field this->caml_object protected from a GC move during camlidl_acquire_runtime() ? Fabrice On 07/01/2011 02:54 PM, Dmitry Bely wrote: > 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 > --------------050205080400070908000202 Content-Type: text/x-vcard; charset=utf-8; name="fabrice_le_fessant.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fabrice_le_fessant.vcf" begin:vcard fn:Fabrice LE FESSANT n:LE FESSANT;Fabrice org:INRIA Saclay -- Ile-de-France;P2P & OCaml adr;quoted-printable:;;Parc Orsay Universit=C3=A9 ;Orsay CEDEX;;91893;France email;internet:fabrice.le_fessant@inria.fr title;quoted-printable:Charg=C3=A9 de Recherche tel;work:+33 1 74 85 42 14 tel;fax:+33 1 74 85 42 49 url:http://fabrice.lefessant.net/ version:2.1 end:vcard --------------050205080400070908000202--