Skip to content

Commit c27e319

Browse files
committed
more details
1 parent 790a244 commit c27e319

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rfcs/0000-unaligned-fn-ptr.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Saying anything about their alignment requirements is actually non-trivial: we w
2626
Preferably, there would be way for code to actually query this alignment requirement (similar to `mem::align_of`).
2727
To avoid having to create all that infrastructure, I propose we instead declare that function pointers do not have to be aligned.
2828

29-
On most current platforms, we could not make any alignment requirement anyway: on x86, there is no alignment for code, and while ARM does have 2-byte alignment, it uses the least significant bit to encode the instruction set (thumb or not) of the pointee, so function pointers themselves are not guaranteed to be aligned.
29+
On most current platforms, we could not make any alignment requirement anyway: on x86, there is no alignment for code, and while ARM has 2- or 4-byte alignment (depending on platform details), it uses the least significant bit to encode the instruction set (thumb or not) of the pointee, so function pointers themselves are not guaranteed to be aligned.
3030

3131
Beyond alignment, while we could require the function pointer to point to a "valid sequence of instructions", it is unclear what the benefit of that would be.
3232

0 commit comments

Comments
 (0)