From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5589 invoked by alias); 10 Oct 2014 18:44:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 5500 invoked by uid 89); 10 Oct 2014 18:44:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,LIKELY_SPAM_BODY,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 10 Oct 2014 18:44:57 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9AIisiU024593 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 10 Oct 2014 14:44:54 -0400 Received: from localhost (dhcp-10-15-16-169.yyz.redhat.com [10.15.16.169]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9AIir3Q030547 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Fri, 10 Oct 2014 14:44:54 -0400 From: Sergio Durigan Junior To: jose.marchesi@oracle.com (Jose E. Marchesi) Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 5/9] New probe type: DTrace USDT probes. References: <1411724905-31234-1-git-send-email-jose.marchesi@oracle.com> <1411724905-31234-6-git-send-email-jose.marchesi@oracle.com> <87y4syt5zn.fsf@redhat.com> <87iojrevbz.fsf@oracle.com> <87ppdz23p1.fsf@redhat.com> <87lhondb4y.fsf@oracle.com> X-URL: http://blog.sergiodj.net Date: Fri, 10 Oct 2014 18:44:00 -0000 In-Reply-To: <87lhondb4y.fsf@oracle.com> (Jose E. Marchesi's message of "Fri, 10 Oct 2014 20:37:17 +0200") Message-ID: <87d29z228q.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00278.txt.bz2 On Friday, October 10 2014, Jose E. Marchesi wrote: > > You should free the enablers VEC in the end of the function. You could > > probably make a cleanup and call it later. > > > > Hmm, I don't see the need of doing a deep copy of the vector, nor I > > remember why I felt it was necessary to do it when I wrote the original > > code. > > > > I changed that to: > > > > /* Add the vector of enablers to this probe, if any. */ > > ret->enablers = enablers; > > > > But maybe(probably) I am missing something? :? > > Hm, right. But if you do that, you will have to adjust > dtrace_probe_destroy, because it will be freeing the same 'enablers' > over and over... > > Aaah, that was indeed the reason! A "DOF probe" translates into 0 or > more gdb probes, and they all share the same vector of enablers. > > Maintaining a copy of the enablers per gdb probe makes it trivial to > manage its memory. Otherwise we would need to keep track of which > enabler vectors are shared by which gdb probes... argh! > > I will roll back to the deep copy approach :) :-) And then you need that cleanup I mentioned before :-P. -- Sergio GPG key ID: 0x65FC5E36 Please send encrypted e-mail if possible http://sergiodj.net/