git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 3 of 25 in “Convert revision.c to parseopt part 1/4”
  1. 00/19 Convert revision.c to parseopt part 1/4Nguyễn Thái Ngọc Duy, May 8, 2019
  2. 01/19 revision.h: avoid bit fields in struct rev_infoNguyễn Thái Ngọc Duy, May 8, 2019
  3. Derrick StoleeMay 8, 2019
  4. Duy NguyenMay 8, 2019
  5. Derrick StoleeMay 8, 2019
  6. Duy NguyenMay 9, 2019
  7. Derrick StoleeMay 9, 2019
  8. 02/19 revision.h: move repo field downNguyễn Thái Ngọc Duy, May 8, 2019
  9. 03/19 revision.c: prepare to convert handle_revision_pseudo_opt()Nguyễn Thái Ngọc Duy, May 8, 2019
  10. 04/19 rev-parseopt: convert --allNguyễn Thái Ngọc Duy, May 8, 2019
  11. 05/19 rev-parseopt: convert --branchesNguyễn Thái Ngọc Duy, May 8, 2019
  12. 06/19 rev-parseopt: convert --bisectNguyễn Thái Ngọc Duy, May 8, 2019
  13. 07/19 rev-parseopt: convert --tagsNguyễn Thái Ngọc Duy, May 8, 2019
  14. 08/19 rev-parseopt: convert --remotesNguyễn Thái Ngọc Duy, May 8, 2019
  15. 09/19 rev-parseopt: convert --globNguyễn Thái Ngọc Duy, May 8, 2019
  16. 10/19 rev-parseopt: convert --excludeNguyễn Thái Ngọc Duy, May 8, 2019
  17. 11/19 rev-parseopt: convert --reflogNguyễn Thái Ngọc Duy, May 8, 2019
  18. 12/19 rev-parseopt: convert --indexed-objectsNguyễn Thái Ngọc Duy, May 8, 2019
  19. 13/19 rev-parseopt: convert --notNguyễn Thái Ngọc Duy, May 8, 2019
  20. 14/19 rev-parseopt: convert --no-walk and --do-walkNguyễn Thái Ngọc Duy, May 8, 2019
  21. 15/19 rev-parseopt: convert --single-worktreeNguyễn Thái Ngọc Duy, May 8, 2019
  22. 16/19 rev-parseopt: prepare to convert handle_revision_opt()Nguyễn Thái Ngọc Duy, May 8, 2019
  23. 17/19 rev-parseopt: convert --max-countNguyễn Thái Ngọc Duy, May 8, 2019
  24. 18/19 rev-parseopt: convert --skipNguyễn Thái Ngọc Duy, May 8, 2019
  25. 19/19 rev-parseopt: convert --min-age and --max-ageNguyễn Thái Ngọc Duy, May 8, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.