This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [wip] BFD from an arbitrary object; Was: provide pass-throughvalue in bfd_elf_bfd_from_remote_memory



IMHO the right way to do it is to define a "base class" struct, with only common elements (starting with int length and struct ops*), and let the I/O module create a derived structure with extra fields if it needs it. I don't like the "void *cookie" solution because (1) you get an additional pointer dereferencing cost, and (2) you get an extra set of malloc/free overhead.

Note that it is:


+. struct bfd_file stream;

and not:

+. struct bfd_file *stream;

however, what ever.

Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]