This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: [RFC/RFA] add struct parse_context to all command functions


> Joel> I like the idea as well. Just one question: Why did you elect to
> Joel> pass the structure as a pointer, rather than the structure
> Joel> itself?
> 
> To avoid copying.  Most users just reference fields from the
> structure, or pass it through unmodified.  So, this is more efficient
> in the common cases.

Ah, yes, of course. I was just confused with the pass-by-reference at
the ABI level. I think the same reasons apply to struct parse_context,
so I'll adjust my approach accordingly - even if the structure is small
right now (3 words for now), it's still bigger than 1 address...

-- 
Joel


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