Skip to content

Commit

Permalink
Use bitfields to reduce the size of token by a few bytes.
Browse files Browse the repository at this point in the history
See #202.
  • Loading branch information
tzlaine committed Nov 8, 2024
1 parent c1cc177 commit 9e8da80
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/boost/parser/lexer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,10 @@ namespace boost { namespace parser {
long double d_;
string_view sv_;
} value_;
int id_;
detail::token_kind kind_;
// TODO: Document the 22-bit size limitation on id_ (values must be
// positive).
int id_ : 24;
detail::token_kind kind_ : 8;
};

#if defined(BOOST_PARSER_TESTING)
Expand Down

0 comments on commit 9e8da80

Please sign in to comment.