Skip to content

Update constants in spec/ebpf_base.rs to be statics - #2

Closed
vcfxb wants to merge 4 commits into
elazarg:mainfrom
vcfxb:main
Closed

vcfxb wants to merge 4 commits into
elazarg:mainfrom
vcfxb:main

Conversation

@vcfxb

@vcfxb vcfxb commented Apr 6, 2026

Copy link
Copy Markdown

Rust does not support build-time definitions in the same way used in vbpf/prevail#1060, so we instead make those constants into global statics, which may be initialized once before any other library functions are called (otherwise they'll use the existing defaults).

All references to those constants have been updated to use the statics, which unfortunately means that the implementation of crab/bitset_domain.rs is no longer constant size, and now uses Vecs.

…nd LazyLock where appropriate.

Rust does not support build-time definitions in the same way used in vbpf/prevail#1060, so we instead make those
constants into global statics, which may be initialized once before any other library functions are called (otherwise they'll use the existing defaults).

All references to those constants have been updated to use the statics, which unfortunately means that the implementation of crab/bitset_domain.rs is
no longer constant size, and now uses `Vec`s.

Signed-off-by: Venus Xeon-Blonde <venus@cloudflare.com>
vcfxb added 3 commits April 6, 2026 16:06
Signed-off-by: Venus Xeon-Blonde <venus@cloudflare.com>
Signed-off-by: Venus Xeon-Blonde <venus@cloudflare.com>
Signed-off-by: Venus Xeon-Blonde <venus@cloudflare.com>
@vcfxb

vcfxb commented Apr 14, 2026

Copy link
Copy Markdown
Author

I can close this one too I think once the changes from vbpf/prevail#1070 make it over here (and perhaps the crate gets a new release)

@elazarg

elazarg commented Apr 14, 2026

Copy link
Copy Markdown
Owner

With v0.2.1 ported, I think this can be closed

@vcfxb

vcfxb commented Apr 14, 2026

Copy link
Copy Markdown
Author

Looks good! Thanks!

@vcfxb vcfxb closed this Apr 14, 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.

2 participants