Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60302 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82190 invoked from network); 24 Apr 2012 23:28:41 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Apr 2012 23:28:41 -0000 Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.45 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.210.45 mail-pz0-f45.google.com Received: from [209.85.210.45] ([209.85.210.45:49372] helo=mail-pz0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A6/B4-54790-627379F4 for ; Tue, 24 Apr 2012 19:28:39 -0400 Received: by dacx6 with SMTP id x6so1677479dac.18 for ; Tue, 24 Apr 2012 16:28:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=W+CKVKkZHReXO49S9eAts/ZxbqoSuBzQlYmBim5QkzQ=; b=I/WriTMn4oniejtH/bSwhxWV07K8hH0AI8RZR96NDBoyy/1U+WsQby4kshlzrW3LwZ u3UtPsICBUHEWyNgFq3Q7gJWmAUpvuZjTXStMvsqxo1/E8TinGTtZXIhJfWyAJTL5o5t C8o1eapab2ihAQVjPmVcVrgt5JGpYywvctItQmoepi8e32CJZJbNpNKbpIsz7J5beYcB uZp3BoUcjJvSLC1hH2uf39jr+Lx6VM715/rxWTQ/gnDsyBkxenbKVAdc9f93hK9DFExJ r+kUNiep1vWnYRXnud1Ench/AZfdxFRPKnmBIsGM+xhMoQmJ1OUB+RUsv6XVB4eolG1O HPKA== MIME-Version: 1.0 Received: by 10.68.244.102 with SMTP id xf6mr1912409pbc.115.1335310115366; Tue, 24 Apr 2012 16:28:35 -0700 (PDT) Sender: ekneuss@gmail.com Received: by 10.68.72.6 with HTTP; Tue, 24 Apr 2012 16:28:35 -0700 (PDT) In-Reply-To: References: Date: Wed, 25 Apr 2012 01:28:35 +0200 X-Google-Sender-Auth: Gox_XoWsRHzaZN3YCLImbrwRCWc Message-ID: To: Yader Hernandez Cc: PHP Developers Mailing List Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] freeing zvals ref count From: colder@php.net (Etienne Kneuss) Hi, On Wed, Apr 25, 2012 at 01:25, Yader Hernandez wrote: > Hello, > > In the extension I'm currently working on, I call add_index_zval and on > success, I call Z_ADDREF_P on the new zval. > > When I'm freeing everything, I need to remove the ref count. Digging > through the source code, I found Z_DELREF_P. Would this be the correct > macro to call? Is there anything else to keep in mind when calling it? You should use zval_ptr_dtor instead. it will delref and free in case the refcount hits 0. Best, > > thx -- Etienne Kneuss http://www.colder.ch