14#include "arccore/serialize/BasicSerializer.h"
16#include "arccore/base/ArgumentException.h"
17#include "arccore/base/FatalErrorException.h"
19#include "arccore/serialize/internal/BasicSerializerInternal.h"
49:
public BasicSerializer::Impl
52 static constexpr int IDX_TAG = 0;
54 static constexpr Int64 SERIALIZE_TAG = 0x7a9b3cd0;
56 static constexpr int IDX_VERSION = 1;
58 static constexpr int IDX_RESERVED1 = 2;
61 static constexpr int IDX_TOTAL_SIZE = 3;
63 static constexpr int IDX_NB_BYTE = 4;
64 static constexpr int IDX_NB_FLOAT16 = 5;
65 static constexpr int IDX_NB_FLOAT32 = 6;
66 static constexpr int IDX_NB_FLOAT64 = 7;
67 static constexpr int IDX_NB_FLOAT128 = 8;
68 static constexpr int IDX_NB_INT16 = 9;
69 static constexpr int IDX_NB_INT32 = 10;
70 static constexpr int IDX_NB_INT64 = 11;
71 static constexpr int IDX_NB_INT128 = 12;
72 static constexpr int IDX_NB_INT8 = 13;
73 static constexpr int IDX_NB_BFLOAT16 = 14;
76 static constexpr int IDX_POS_BYTE = 32;
77 static constexpr int IDX_POS_FLOAT16 = 33;
78 static constexpr int IDX_POS_FLOAT32 = 34;
79 static constexpr int IDX_POS_FLOAT64 = 35;
80 static constexpr int IDX_POS_FLOAT128 = 36;
81 static constexpr int IDX_POS_INT16 = 37;
82 static constexpr int IDX_POS_INT32 = 38;
83 static constexpr int IDX_POS_INT64 = 39;
84 static constexpr int IDX_POS_INT128 = 40;
85 static constexpr int IDX_POS_INT8 = 41;
86 static constexpr int IDX_POS_BFLOAT16 = 42;
88 static constexpr Integer NB_SIZE_ELEM = 128;
101 Int64 m_original_size = 0;
102 Int64 m_padded_size = 0;
139 Span<Int32> getInt32Buffer()
override {
return m_int32_view; }
140 Span<Int64> getInt64Buffer()
override {
return m_int64_view; }
141 Span<Byte> getByteBuffer()
override {
return m_byte_view; }
142 Span<Int8> getInt8Buffer()
override {
return m_int8_view; }
143 Span<Float16> getFloat16Buffer()
override {
return m_float16_view; }
144 Span<BFloat16> getBFloat16Buffer()
override {
return m_bfloat16_view; }
145 Span<Float32> getFloat32Buffer()
override {
return m_float32_view; }
146 Span<Float128> getFloat128Buffer()
override {
return m_float128_view; }
147 Span<Int128> getInt128Buffer()
override {
return m_int128_view; }
153 Int64 nb_float16 = 0;
154 Int64 nb_bfloat16 = 0;
155 Int64 nb_float32 = 0;
156 Int64 nb_float128 = 0;
158 allocateBuffer(nb_real, nb_int16, nb_int32, nb_int64, nb_byte, nb_int8,
159 nb_float16, nb_bfloat16, nb_float32, nb_float128, nb_int128);
166 SizeInfo size_info = getPaddingSize(NB_SIZE_ELEM,
sizeof(
Int64));
167 Int64 total = size_info.m_padded_size;
169 Int64 real_position = total;
170 SizeInfo padded_real_size = getPaddingSize(nb_real,
sizeof(
Real));
171 total += padded_real_size.m_padded_size;
173 Int64 int16_position = total;
174 SizeInfo padded_int16_size = getPaddingSize(nb_int16,
sizeof(
Int16));
175 total += padded_int16_size.m_padded_size;
177 Int64 int32_position = total;
178 SizeInfo padded_int32_size = getPaddingSize(nb_int32,
sizeof(
Int32));
179 total += padded_int32_size.m_padded_size;
181 Int64 int64_position = total;
182 SizeInfo padded_int64_size = getPaddingSize(nb_int64,
sizeof(
Int64));
183 total += padded_int64_size.m_padded_size;
185 Int64 byte_position = total;
186 SizeInfo padded_byte_size = getPaddingSize(nb_byte,
sizeof(
Byte));
187 total += padded_byte_size.m_padded_size;
189 Int64 int8_position = total;
190 SizeInfo padded_int8_size = getPaddingSize(nb_int8,
sizeof(
Int8));
191 total += padded_int8_size.m_padded_size;
193 Int64 float16_position = total;
194 SizeInfo padded_float16_size = getPaddingSize(nb_float16,
sizeof(
Float16));
195 total += padded_float16_size.m_padded_size;
197 Int64 bfloat16_position = total;
198 SizeInfo padded_bfloat16_size = getPaddingSize(nb_bfloat16,
sizeof(BFloat16));
199 total += padded_bfloat16_size.m_padded_size;
201 Int64 float32_position = total;
202 SizeInfo padded_float32_size = getPaddingSize(nb_float32,
sizeof(
Float32));
203 total += padded_float32_size.m_padded_size;
205 Int64 float128_position = total;
206 SizeInfo padded_float128_size = getPaddingSize(nb_float128,
sizeof(
Float128));
207 total += padded_float128_size.m_padded_size;
209 Int64 int128_position = total;
210 SizeInfo padded_int128_size = getPaddingSize(nb_int128,
sizeof(
Int128));
211 total += padded_int128_size.m_padded_size;
275 void copy(Impl* rhs)
override
292 Span<Byte> globalBuffer()
override
297 Span<const Byte> globalBuffer()
const override
302 ConstArrayView<Int64> sizesBuffer()
const override
307 void preallocate(
Int64 size)
override
313 void releaseBuffer()
override
318 void setFromSizes()
override
321 if (tag_id != SERIALIZE_TAG)
322 ARCCORE_FATAL(
"Bad tag id '{0}' for serializer (expected={1})."
323 "The data are not from a BasicSerializer. SizeView={2}",
327 ARCCORE_FATAL(
"Bad version '{0}' for serializer. Only version 1 is allowed", version_id);
368 ConstArrayView<Byte> copyAndGetSizesBuffer()
override
378 Int64 totalSize()
const override
383 void printSizes(std::ostream& o)
const override
385 ConstArrayView<Int64> sbuf_sizes = this->sizesBuffer();
386 Int64 total_size = totalSize();
388 o <<
" bytes " << bytes.size()
389 <<
" total_size " << total_size
390 <<
" float64 " << sbuf_sizes[IDX_NB_FLOAT64]
391 <<
" int64 " << sbuf_sizes[IDX_NB_INT64]
392 <<
" int32 " << sbuf_sizes[IDX_NB_INT32]
393 <<
" int16 " << sbuf_sizes[IDX_NB_INT16]
394 <<
" byte " << sbuf_sizes[IDX_NB_BYTE]
395 <<
" int8 " << sbuf_sizes[IDX_NB_INT8]
396 <<
" float16 " << sbuf_sizes[IDX_NB_FLOAT16]
397 <<
" bfloat16 " << sbuf_sizes[IDX_NB_BFLOAT16]
398 <<
" float32 " << sbuf_sizes[IDX_NB_FLOAT32]
399 <<
" float128 " << sbuf_sizes[IDX_NB_FLOAT128]
400 <<
" int128 " << sbuf_sizes[IDX_NB_INT128]
401 <<
" ptr=" << (
void*)bytes.data();
409 ARCCORE_FATAL(
"Bad number of element '{0}' (should be >=0)", nb_elem);
412 Int64 s = nb_elem * elem_size;
413 Int64 pad = s % ALIGN_SIZE;
416 Int64 new_size = s + (ALIGN_SIZE - pad);
417 if ((new_size % ALIGN_SIZE) != 0)
420 return { s, new_size };
431 Int64 begin = position + size_info.m_original_size;
432 Int64 end = position + size_info.m_padded_size;
441 for (
Int64 i = 0, s = buf.
size(); i < s; ++i)
445 void _checkAlignment()
460 void _checkAddr(
void* ptr)
463 if ((addr % ALIGN_SIZE) != 0) {
465 ARCCORE_FATAL(
"Bad alignment addr={0} - {1}", addr, (addr % ALIGN_SIZE));
469 void _printAlignment()
487 void _printAddr(
void* ptr,
const String& name)
490 std::cout <<
"Align type=" << name <<
" addr=" << addr <<
" offset=" << (addr % ALIGN_SIZE) <<
'\n';
493 void _allocBuffer(
Int64 size)
497 m_buffer.resize(size + ALIGN_SIZE * 4);
499 Int64 padding = addr % ALIGN_SIZE;
502 position = ALIGN_SIZE - padding;
505 Int64 new_size = (size + ALIGN_SIZE) - (size % ALIGN_SIZE);
509 auto padding_view =
m_buffer.span().subspan(position + size, new_size - size);
520BasicSerializer::Impl2::
523, m_read_mode(ReadReplace)
531BasicSerializer::Impl2::
540void BasicSerializer::Impl2::
543 ARCCORE_ASSERT((m_mode == ModeReserve), (
"Bad mode"));
546 m_real.m_reserved_size += n;
549 m_int64.m_reserved_size += n;
552 m_int32.m_reserved_size += n;
555 m_int16.m_reserved_size += n;
558 m_byte.m_reserved_size += n;
561 m_int8.m_reserved_size += n;
564 m_float16.m_reserved_size += n;
567 m_bfloat16.m_reserved_size += n;
570 m_float32.m_reserved_size += n;
573 m_float128.m_reserved_size += n;
576 m_int128.m_reserved_size += n;
581 if (m_is_serialize_typeinfo)
583 m_byte.m_reserved_size += nb_put;
589void BasicSerializer::Impl2::
592 ARCCORE_ASSERT((m_mode == ModeReserve), (
"Bad mode"));
595 m_real.m_reserved_size += n;
598 m_int64.m_reserved_size += n;
601 m_int32.m_reserved_size += n;
604 m_int16.m_reserved_size += n;
607 m_byte.m_reserved_size += n;
610 m_int8.m_reserved_size += n;
613 m_float16.m_reserved_size += n;
615 case eBasicDataType::BFloat16:
616 m_bfloat16.m_reserved_size += n;
619 m_float32.m_reserved_size += n;
622 m_float128.m_reserved_size += n;
625 m_int128.m_reserved_size += n;
630 if (m_is_serialize_typeinfo)
632 m_byte.m_reserved_size += nb_put;
638void BasicSerializer::Impl2::
641 if (m_is_serialize_typeinfo) {
650void BasicSerializer::Impl2::
653 if (!m_is_serialize_typeinfo)
658 if (t != expected_type)
659 ARCCORE_FATAL(
"Bad serialized type t='{0}' int={1}' expected='{2}'", t, (
int)t, expected_type);
665void BasicSerializer::Impl2::
668 m_p->allocateBuffer(m_real.m_reserved_size, m_int16.m_reserved_size, m_int32.m_reserved_size,
669 m_int64.m_reserved_size, m_byte.m_reserved_size, m_int8.m_reserved_size,
670 m_float16.m_reserved_size, m_bfloat16.m_reserved_size, m_float32.m_reserved_size,
671 m_float128.m_reserved_size, m_int128.m_reserved_size);
678void BasicSerializer::Impl2::
688void BasicSerializer::Impl2::
691 m_real.m_buffer = m_p->getRealBuffer();
692 m_real.m_current_position = 0;
694 m_int64.m_buffer = m_p->getInt64Buffer();
695 m_int64.m_current_position = 0;
697 m_int32.m_buffer = m_p->getInt32Buffer();
698 m_int32.m_current_position = 0;
700 m_int16.m_buffer = m_p->getInt16Buffer();
701 m_int16.m_current_position = 0;
703 m_byte.m_buffer = m_p->getByteBuffer();
704 m_byte.m_current_position = 0;
706 m_int8.m_buffer = m_p->getInt8Buffer();
707 m_int8.m_current_position = 0;
709 m_float16.m_buffer = m_p->getFloat16Buffer();
710 m_float16.m_current_position = 0;
712 m_bfloat16.m_buffer = m_p->getBFloat16Buffer();
713 m_bfloat16.m_current_position = 0;
715 m_float32.m_buffer = m_p->getFloat32Buffer();
716 m_float32.m_current_position = 0;
718 m_float128.m_buffer = m_p->getFloat128Buffer();
719 m_float128.m_current_position = 0;
721 m_int128.m_buffer = m_p->getInt128Buffer();
722 m_int128.m_current_position = 0;
728void BasicSerializer::Impl2::
733 Int64 nb_float16 = 0;
734 Int64 nb_bfloat16 = 0;
735 Int64 nb_float32 = 0;
736 Int64 nb_float128 = 0;
738 allocateBuffer(nb_real, nb_int16, nb_int32, nb_int64, nb_byte, nb_int8,
739 nb_float16, nb_bfloat16, nb_float32, nb_float128, nb_int128);
745void BasicSerializer::Impl2::
750 m_real.m_reserved_size = nb_real;
751 m_int64.m_reserved_size = nb_int64;
752 m_int32.m_reserved_size = nb_int32;
753 m_int16.m_reserved_size = nb_int16;
754 m_byte.m_reserved_size = nb_byte;
755 m_int8.m_reserved_size = nb_int8;
756 m_float16.m_reserved_size = nb_float16;
757 m_bfloat16.m_reserved_size = nb_bfloat16;
758 m_float32.m_reserved_size = nb_float32;
759 m_float128.m_reserved_size = nb_float128;
760 m_int128.m_reserved_size = nb_int128;
767void BasicSerializer::Impl2::
770 auto rhs_p = rhs._p();
782 allocateBuffer(real_b.size(), int16_b.size(), int32_b.size(), int64_b.size(), byte_b.size(),
783 int8_b.size(), float16_b.size(), bfloat16_b.size(),
784 float32_b.size(), float128_b.size(), int128_b.size());
791void BasicSerializer::Impl2::
792setMode(eMode new_mode)
795 m_real.m_current_position = 0;
796 m_int64.m_current_position = 0;
797 m_int32.m_current_position = 0;
798 m_int16.m_current_position = 0;
799 m_byte.m_current_position = 0;
800 m_int8.m_current_position = 0;
801 m_float16.m_current_position = 0;
802 m_bfloat16.m_current_position = 0;
803 m_float32.m_current_position = 0;
804 m_float128.m_current_position = 0;
805 m_int128.m_current_position = 0;
845BasicSerializer::Impl* BasicSerializer::
857 return m_p2->m_real.m_buffer;
861 return m_p2->m_int64.m_buffer;
865 return m_p2->m_int32.m_buffer;
869 return m_p2->m_int16.m_buffer;
873 return m_p2->m_byte.m_buffer;
882 m_p2->reserve(dt, n, 1);
891 m_p2->reserve(dt, n, 1);
900 m_p2->reserve(dt, n, n);
909 m_p2->reserve(dt, n, n);
1008 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1010 m_p2->m_real.put(values);
1019 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1021 m_p2->m_int64.put(values);
1030 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1032 m_p2->m_int32.put(values);
1041 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1043 m_p2->m_int16.put(values);
1052 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1054 m_p2->m_byte.put(values);
1063 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1065 m_p2->m_int8.put(values);
1074 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1076 m_p2->m_float16.put(values);
1085 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1086 m_p2->putType(eBasicDataType::BFloat16);
1087 m_p2->m_bfloat16.put(values);
1096 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1098 m_p2->m_float32.put(values);
1107 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1109 m_p2->m_float128.put(values);
1118 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1120 m_p2->m_int128.put(values);
1129 ARCCORE_ASSERT((m_p2->m_mode ==
ModePut), (
"Bad mode"));
1221 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1223 m_p2->m_real.get(values);
1232 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1234 m_p2->m_int64.get(values);
1243 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1245 m_p2->m_int32.get(values);
1254 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1256 m_p2->m_int16.get(values);
1265 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1267 m_p2->m_byte.get(values);
1276 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1278 m_p2->m_int8.get(values);
1287 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1289 m_p2->m_float16.get(values);
1298 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1299 m_p2->getAndCheckType(eBasicDataType::BFloat16);
1300 m_p2->m_bfloat16.get(values);
1309 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1311 m_p2->m_float32.get(values);
1320 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1322 m_p2->m_float128.get(values);
1331 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1333 m_p2->m_int128.get(values);
1424 ARCCORE_ASSERT((m_p2->m_mode ==
ModeGet), (
"Bad mode"));
1437 m_p2->allocateBuffer();
1446 return m_p2->m_mode;
1455 m_p2->setMode(new_mode);
1464 return m_p2->m_read_mode;
1473 m_p2->m_read_mode = new_read_mode;
1483 m_p2->allocateBuffer(nb_real, nb_int16, nb_int32, nb_int64, nb_byte, 0, 0, 0, 0, 0, 0);
1490copy(
const BasicSerializer& rhs)
1501 auto sbuf =
dynamic_cast<const BasicSerializer*
>(from);
1513 return _p()->globalBuffer();
1519Span<const Byte> BasicSerializer::
1522 return _p()->globalBuffer();
1529copyAndGetSizesBuffer()
1531 return _p()->copyAndGetSizesBuffer();
1540 return _p()->sizesBuffer();
1546void BasicSerializer::
1547preallocate(
Int64 size)
1549 return _p()->preallocate(size);
1555void BasicSerializer::
1558 _p()->releaseBuffer();
1564void BasicSerializer::
1567 m_p2->setFromSizes();
1573Int64 BasicSerializer::
1576 return _p()->totalSize();
1582void BasicSerializer::
1583printSizes(std::ostream& o)
const
1585 _p()->printSizes(o);
1596 preallocate(nb_byte);
1597 globalBuffer().copy(buf);
1607 m_p2->setSerializeTypeInfo(v);
1613bool BasicSerializer::
1614isSerializeTypeInfo()
const
1616 return m_p2->isSerializeTypeInfo();
#define ARCCORE_FATAL(...)
Macro throwing a FatalErrorException.
#define ARCCORE_THROW(exception_class,...)
Macro to throw an exception with formatting.
Exception when an argument is invalid.
Modifiable view of an array of type T.
Base class for 1D data vectors.
Span< const T > span() const
Immutable view of this array.
void resize(Int64 s)
Changes the number of elements in the array to s.
Implementation of a contiguous in-memory serialization buffer.
UniqueArray< Byte > m_buffer
Array containing the serialized data.
ArrayView< Int64 > m_sizes_view
View for sizes (must be a multiple of ALIGN_SIZE);.
Span< Int16 > m_int16_view
View on 16-bit integers.
Span< Float16 > m_float16_view
View on Float16.
Span< BFloat16 > m_bfloat16_view
View on BFloat16.
Span< Int32 > m_int32_view
View on 32-bit integers.
Int64 m_size_copy_buffer[NB_SIZE_ELEM]
Copy of sizes used for multi-part sending.
Span< Real > m_real_view
View on reals;.
Span< Int128 > m_int128_view
View on Int128.
Span< Int8 > m_int8_view
View on Int8.
Span< Byte > m_byte_view
View on bytes.
Span< Float128 > m_float128_view
View on Float128.
void _fillPadding(Int64 position, SizeInfo size_info)
Fills the padding zones corresponding to the padding with a fixed value. This prevents having uniniti...
Span< Int64 > m_int64_view
View on 64-bit integers.
Span< Byte > m_buffer_view
View aligned to ALIGN_SIZE of m_buffer.
Span< Float32 > m_float32_view
View on Float32.
void getArray(Array< Real > &values) override
Resize and fill values.
void initFromBuffer(Span< const Byte > buf)
Initializes the serializer for reading from the data buf.
void putSpan(Span< const Int8 > values) override
Add the array values.
void setReadMode(eReadMode new_read_mode) override
Sets the read mode.
void setSerializeTypeInfo(bool v)
Indicates whether to serialize the data type to ensure consistency.
void putInt64(Int64 value) override
Add the integer value.
void getSpan(Span< Real > values) override
Retrieve the array values.
static ARCCORE_CONSTEXPR Integer paddingSize()
Padding and alignment size.
eReadMode readMode() const override
Read mode.
void copy(const ISerializer *from) override
Copies the data from from into this instance.
void put(Span< const Real > values) override
Add the array values.
void reserve(eBasicDataType dt, Int64 n) override
Reserves memory for n objects of type dt.
void allocateBuffer() override
Allocates the serializer memory.
void reserveSpan(eDataType dt, Int64 n) override
Reserves memory for n values of dt.
void reserveArray(Span< const Real > values) override
Reserve to save the number of elements and the values elements.
Int64 getInt64() override
Retrieve a size.
void putArray(Span< const Real > values) override
Save the number of elements and the values elements.
void get(ArrayView< Real > values) override
Retrieve the array values.
void setMode(eMode new_mode) override
Sets the current mode.
eMode mode() const override
Current operating mode.
Constant view of an array of type T.
void reserveInt64(Int64 n)
Reserve for n Int64.
eMode
Serializer operating mode.
@ ModePut
The serializer expects reserve().
@ ModeGet
The serializer expects get().
eReadMode
Serializer read mode.
constexpr __host__ __device__ pointer data() const noexcept
Pointer to the start of the view.
constexpr __host__ __device__ SizeType size() const noexcept
Returns the size of the array.
View of an array of elements of type T.
Unicode character string.
Int64 length() const
Returns the length of the string.
Span< const Byte > bytes() const
Returns the conversion of the instance into UTF-8 encoding.
1D data vector with value semantics (STL style).
constexpr __host__ __device__ pointer data() const noexcept
Pointer to the start of the view.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int8_t Int8
Signed integer type of 8 bits.
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
eBasicDataType
Type of a basic data item.
@ Float32
Float32 data type.
@ Float16
Float16 data type.
@ Int128
128-bit integer data type
@ Int16
16-bit integer data type
@ Int8
< BFloat16 data type
@ Int32
32-bit integer data type
@ Float64
Float64 data type.
@ Float128
Float128 data type.
@ Int64
64-bit integer data type
std::int16_t Int16
Signed integer type of 16 bits.
double Real
Type representing a real number.
unsigned char Byte
Type of a byte.
float Float32
IEEE-753 single-precision floating-point type.
@ DT_Float32
'Float32' data type
@ DT_Int128
128-bit integer data type
@ DT_Int16
16-bit integer data type
@ DT_Int8
8-bit integer data type
@ DT_Int32
32-bit integer data type
@ DT_Float16
'Float16' data type
@ DT_Int64
64-bit integer data type
@ DT_BFloat16
'BFloat16' data type
@ DT_Float128
128-bit floating point data type
std::int32_t Int32
Signed integer type of 32 bits.
Information about the allocated size with and without padding.