Allocate the memory of struct more efficiently in C++

Viewed 150

I'm trying the construct a struct in C++ as below:

struct kmer_value {
    uint32_t count : 32;
    uint32_t  path_length : 32;
    uint8_t acgt_prev : 4;
    uint8_t  acgt_next : 4;
}

The struct currently takes the memory of 12 bytes, but I want to reduce the size to 9 bytes. Is there any way to realize it?

Thank you.

1 Answers
Related