pack struct
This commit is contained in:
parent
17d2baf736
commit
9a4859efb3
@ -7,6 +7,8 @@
|
|||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
// TODO: use pack(16) instead to guarantie same size on 32bit and 64bit?
|
||||||
|
#pragma pack(1)
|
||||||
struct CM_InternalStringView final {
|
struct CM_InternalStringView final {
|
||||||
const char* start {nullptr};
|
const char* start {nullptr};
|
||||||
uint64_t extend {0};
|
uint64_t extend {0};
|
||||||
@ -22,6 +24,7 @@ struct CM_InternalStringView final {
|
|||||||
static_assert(sizeof(CM_InternalStringView) == sizeof(const char*) + sizeof(uint64_t), "guarantee abi (hope)");
|
static_assert(sizeof(CM_InternalStringView) == sizeof(const char*) + sizeof(uint64_t), "guarantee abi (hope)");
|
||||||
|
|
||||||
using CM_ISV = CM_InternalStringView;
|
using CM_ISV = CM_InternalStringView;
|
||||||
|
#pragma pack() // undo pack(1)
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct CM_InternalOptional {
|
struct CM_InternalOptional {
|
||||||
|
Loading…
Reference in New Issue
Block a user