Open
Description
In the aarch64 architecture, atomic instructions have alignment requirements for memory addresses. If these requirements are not met, a bus error may occur.
In C++ code, most objects are created in this form:
void *buf = allocator_.alloc(sizeof(classA));
classA obj = new (buf) classA;
The allocator pre-requests a block of memory from the operating system and initializes objects within this space.This could result in some objects having an improper starting position, leading to errors when executing atomic-related instructions.
For example, some strings require a block of memory to store data. After memory is allocated for the string, the allocated pointer is located at a non-aligned address.
Metadata
Metadata
Assignees
Labels
No labels
Activity