Curl_chunker: shrink the struct

... by removing a field, converting the hex index into a byte and
rearranging the order. Cuts it down from 48 bytes to 32 on x86_64.

Closes #6527
This commit is contained in:
Daniel Stenberg 2021-01-25 17:42:59 +01:00
parent a705f28bb3
commit 5ad377718d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 11 additions and 15 deletions

View file

@ -48,7 +48,7 @@ typedef enum {
big deal. */
CHUNK_POSTLF,
/* Used to mark that we're out of the game. NOTE: that there's a 'dataleft'
/* Used to mark that we're out of the game. NOTE: that there's a 'datasize'
field in the struct that will tell how many bytes that were not passed to
the client in the end of the last buffer! */
CHUNK_STOP,
@ -83,11 +83,10 @@ typedef enum {
const char *Curl_chunked_strerror(CHUNKcode code);
struct Curl_chunker {
char hexbuffer[ CHUNK_MAXNUM_LEN + 1]; /* +1 for null-terminator */
int hexindex;
ChunkyState state;
curl_off_t datasize;
size_t dataleft; /* untouched data amount at the end of the last buffer */
ChunkyState state;
unsigned char hexindex;
char hexbuffer[ CHUNK_MAXNUM_LEN + 1]; /* +1 for null-terminator */
};
/* The following functions are defined in http_chunks.c */