Boost.Pool: различия между версиями

Содержимое удалено Содержимое добавлено
Строка 433:
Поэтому, массивы не могут содержать заполнение, но элементы внутри массивов могут.
 
''Утверждение 2: Любой блок памяти, выделенный как массив символов с помощью оператора new[] (здесь и далее - блок), имеет правильное выравнивание для любого объекта такого же или меньшего размера.''
 
Вытекает из:
 
* [3.7.3.1/2] (Basic concepts::Storage duration::Dynamic storage duration::Allocation functions) "... The pointer returned shall be suitably aligned so that it can be converted to a pointer of any complete object type and then used to access the object or array in the storage allocated ..." <br />
* [3.7.3.1/2] (Основные концепции::Продолжительность хранения::Продолжительность динамического хранения::Функции выделения) "... Возвращаемый указатель должен быть подходящим образом выравнен таким образом, чтобы мог быть преобразован в указатель на любой объект завершенного типа и затем использован для доступа к объекту или массиву в выделенном хранилище ..." <br />
[5.3.4/10] (Expressions::Unary expressions::New) "... For arrays of char and unsigned char, the difference between the result of the new-expression and the address returned by the allocation function shall be an integral multiple of the most stringent alignment requirement (3.9) of any object type whose size is no greater than the size of the array being created. [Note: Because allocation functions are assumed to return pointers to storage that is appropriately aligned for objects of any type, this constraint on array allocation overhead permits the common idiom of allocating character arrays into which objects of other types will later be placed."
[5.3.4/10] (Выражения::Унарные выражения::New) "... Для массивов из char и unsigned char, разница между результатом new-выражения и адресом, возвращаемом функцией выделения должен быть shall be an integral multiple of the most stringent alignment requirement (3.9) of any object type whose size is no greater than the size of the array being created. [Note: Because allocation functions are assumed to return pointers to storage that is appropriately aligned for objects of any type, this constraint on array allocation overhead permits the common idiom of allocating character arrays into which objects of other types will later be placed."