Suppress warning about unnamed struct

This prevents MSVC complaining with

	warning C4201: nonstandard extension used: nameless struct/union

The struct might seem unnecessary to the occasional reader (it did seem
so to this commit's author), but it is not! It is required to align the
fields to a boundary, which is verified by the test suite. Removing that
"unnecessary" `struct` results in this failure:

1: Test command: mimalloc-test-api
[...]
1: test: malloc-zero...  mimalloc: assertion failed: at src/page.c:591, mi_page_init
1:   assertion: "!mi_page_has_aligned(page)"

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin 2019-10-16 23:40:25 +02:00
parent 0fd0122c0a
commit 559688ec64

View File

@ -135,10 +135,11 @@ typedef enum mi_delayed_e {
typedef union mi_page_flags_u {
uint16_t value;
uint8_t full_aligned;
struct {
struct { // force alignment
unsigned in_full:1;
unsigned has_aligned:1;
bool is_zero; // `true` if the blocks in the free list are zero initialized
#pragma warning(suppress:4201)
};
} mi_page_flags_t;