Re: [PATCH 01/19] revision.h: avoid bit fields in struct rev_info
- From
Derrick Stolee <stolee@gmail.com>
- Date
- May 8, 2019, 14:07 UTC
- Message-ID
- <0509589b-7a92-6c05-e404-65a9b2bf5666@gmail.com>
- In-Reply-To
- <20190508111249.15262-2-pclouds@gmail.com>
On 5/8/2019 7:12 AM, Nguyễn Thái Ngọc Duy wrote:
Show 5 quoted lines
> 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?
Thanks, -Stolee