From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11030 invoked by alias); 3 Aug 2012 14:56:21 -0000 Received: (qmail 11017 invoked by uid 22791); 3 Aug 2012 14:56:20 -0000 X-SWARE-Spam-Status: No, hits=-6.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 03 Aug 2012 14:56:07 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q73Eu7C4005418 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 3 Aug 2012 10:56:07 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q73Eu6EY000882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 3 Aug 2012 10:56:06 -0400 From: Tom Tromey To: Binutils Development Subject: [PATCH 5/5] fix up docs Date: Fri, 03 Aug 2012 16:10:00 -0000 Message-ID: <87lihwnhx5.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00059.txt.bz2 This patch fixes up the BFD archive docs to describe memory management for archive member BFDs. * archive.c: Update archive documentation. --- bfd/archive.c | 19 +++++++++++++++---- 1 files changed, 15 insertions(+), 4 deletions(-) diff --git a/bfd/archive.c b/bfd/archive.c index 8407745..d5133d0 100644 --- a/bfd/archive.c +++ b/bfd/archive.c @@ -42,11 +42,22 @@ DESCRIPTION have to read the entire archive if you don't want to! Read it until you find what you want. + A BFD returned by <> will not + automatically be closed. If you want to close it, you must + call <>. If you do not close it, then a second + iteration through the members of an archive may return the + same BFD. + + A member BFD is not fully independent of its containing + archive BFD. So, if you close the archive BFD, you must + ensure that either the member BFDs have been closed first, or + that they are never referred to (and thus effectively leaked). + Archive contents of output BFDs are chained through the - <> pointer in a BFD. The first one is findable through - the <> slot of the archive. Set it with - <> (q.v.). A given BFD may be in only one - open output archive at a time. + <> pointer in a BFD. The first one is findable + through the <> slot of the archive. Set it with + <> (q.v.). A given BFD may be in only + one open output archive at a time. As expected, the BFD archive code is more general than the archive code of any given environment. BFD archives may -- 1.7.7.6