Skip to content

Repr C for zero_copy - #1106

Merged
armaniferrante merged 3 commits into
otter-sec:masterfrom
y2kappa:feature/reprC
Dec 23, 2021
Merged

armaniferrante merged 3 commits into
otter-sec:masterfrom
y2kappa:feature/reprC

Conversation

@y2kappa

@y2kappa y2kappa commented Dec 5, 2021

Copy link
Copy Markdown
Contributor

Fixes #813

@y2kappa
y2kappa marked this pull request as ready for review December 5, 2021 14:43
@y2kappa

y2kappa commented Dec 5, 2021

Copy link
Copy Markdown
Contributor Author

@armaniferrante @dovahcrow

Not ready yet, would like to see if there are any failing tests.

@fanatid

fanatid commented Dec 5, 2021

Copy link
Copy Markdown
Contributor

I think this can be considered as a breaking change and require a major version bump.

@dovahcrow

Copy link
Copy Markdown

Btw what is the alignment requirement for eBPF? E.g. if I run the VM on a 32bit machine, will it change the alignment requirement from 64to 32?

@archseer

archseer commented Dec 9, 2021

Copy link
Copy Markdown
Contributor

The VM registers are always 64-bit wide (even when running inside a 32-bit ARM processor kernel!) and support 32-bit subregister addressing [...]

https://www.collabora.com/news-and-blog/blog/2019/04/15/an-ebpf-overview-part-2-machine-and-bytecode/

So looks like 64 bit alignment.

@archseer

archseer commented Dec 9, 2021

Copy link
Copy Markdown
Contributor

A tip for figuring alignment out: compile with cargo rustc -- -Zprint-type-sizes and then inspect the types for any generated padding.

@armaniferrante
armaniferrante merged commit fa3d190 into otter-sec:master Dec 23, 2021
akash-osec pushed a commit to akash-osec/anchor that referenced this pull request Mar 25, 2026
@jamie-osec jamie-osec added this to the Pre-1.0 milestone Jun 24, 2026
akash-osec pushed a commit to akash-osec/anchor that referenced this pull request Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using repr(C) instead of repr(packed) for zero_copy?

6 participants