Re: [PATCH 01/19] revision.h: avoid bit fields in struct rev_info
- Date: Wed, 8 May 2019 10:07:01 -0400
- From: Derrick Stolee <stolee@xxxxxxxxx>
- Subject: Re: [PATCH 01/19] revision.h: avoid bit fields in struct rev_info
On 5/8/2019 7:12 AM, Nguyễn Thái Ngọc Duy wrote:
> Bitfield addresses cannot be passed around in a pointer. This makes it
> hard to use parse-options to set/unset them. Turn this struct to
> normal integers. This of course increases the size of this struct
> multiple times, but since we only have a handful of rev_info variables
> around, memory consumption is not at all a concern.
I think you are right that this memory trade-off shouldn't be a problem.
What worries me instead is that we are using an "internal" data structure
for option parsing. Would it make more sense to create a struct for use
in the parse_opts method and a method that translates those options into
the bitfield in struct rev_info?