Skip to content

Commit

Permalink
py/misc: Remove use of bitfield from vstr_t.
Browse files Browse the repository at this point in the history
Since there is only one flag, we don't need to use a bitfield in vstr_t.
Compilers emit extra instructions to access a bitfield, so this should
reduce the binary size a small amount.

Signed-off-by: David Lechner <david@pybricks.com>
  • Loading branch information
dlech authored and dpgeorge committed Oct 11, 2022
1 parent 92d9118 commit ab317a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion py/misc.h
Expand Up @@ -179,7 +179,7 @@ typedef struct _vstr_t {
size_t alloc;
size_t len;
char *buf;
bool fixed_buf : 1;
bool fixed_buf;
} vstr_t;

// convenience macro to declare a vstr with a fixed size buffer on the stack
Expand Down

0 comments on commit ab317a0

Please sign in to comment.