* [PATCH 5/5] fix up docs
@ 2012-08-03 16:10 Tom Tromey
2012-08-07 13:21 ` nick clifton
0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2012-08-03 16:10 UTC (permalink / raw)
To: Binutils Development
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 <<bfd_openr_next_archived_file>> will not
+ automatically be closed. If you want to close it, you must
+ call <<bfd_close>>. 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
- <<next>> pointer in a BFD. The first one is findable through
- the <<archive_head>> slot of the archive. Set it with
- <<bfd_set_archive_head>> (q.v.). A given BFD may be in only one
- open output archive at a time.
+ <<archive_next>> pointer in a BFD. The first one is findable
+ through the <<archive_head>> slot of the archive. Set it with
+ <<bfd_set_archive_head>> (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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-08 16:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-03 16:10 [PATCH 5/5] fix up docs Tom Tromey
2012-08-07 13:21 ` nick clifton
2012-08-08 17:21 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).