Address GCC8 warning
The bootstrapping allocator needs to perform a memcpy to bypass the removed move constructors on std::atomic. This is safe as there is no concurrency at this point, but GCC is unhappy with this. This commit moves CI to GCC8 and disables this warning for that line.
This commit is contained in:
@@ -102,9 +102,18 @@ namespace snmalloc
|
||||
MemoryProviderStateMixin<PAL>* allocated =
|
||||
local.alloc_chunk<MemoryProviderStateMixin<PAL>, 1>();
|
||||
|
||||
#ifdef GCC_VERSION_EIGHT_PLUS
|
||||
# pragma GCC diagnostic push
|
||||
# pragma GCC diagnostic ignored "-Wclass-memaccess"
|
||||
#endif
|
||||
// Put temporary allocator we have used, into the permanent storage.
|
||||
// memcpy is safe as this is entirely single threaded.
|
||||
// memcpy is safe as this is entirely single threaded: the move
|
||||
// constructors were removed as unsafe to move std::atomic in a
|
||||
// concurrent setting.
|
||||
memcpy(allocated, &local, sizeof(MemoryProviderStateMixin<PAL>));
|
||||
#ifdef GCC_VERSION_EIGHT_PLUS
|
||||
# pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
return allocated;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user