We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27749ed commit cdf5643Copy full SHA for cdf5643
1 file changed
Python/typecache.c
@@ -14,9 +14,14 @@
14
#include "pycore_pyatomic_ft_wrappers.h"
15
#include "pycore_typeobject.h" // _PyStaticType_GetState()
16
17
-static struct {
+
18
+// This is a union because MSVC doesn't support flexible array member in
19
+// the middle of a struct and we use a char array to reserve space for the
20
+// actual hashtable entries of the empty cache.
21
+static union {
22
struct type_cache cache;
- struct type_cache_entry entries[_Py_TYPECACHE_MINSIZE];
23
+ char storage[sizeof(struct type_cache)
24
+ + _Py_TYPECACHE_MINSIZE * sizeof(struct type_cache_entry)];
25
} empty_cache_storage = {
26
.cache = {
27
.mask = _Py_TYPECACHE_MINSIZE - 1,
0 commit comments