Skip to content

Add half feature with GetSize impls for f16 and bf16#47

Merged
bircni merged 2 commits into
bircni:mainfrom
AlJohri:add-half-feature
May 15, 2026
Merged

Add half feature with GetSize impls for f16 and bf16#47
bircni merged 2 commits into
bircni:mainfrom
AlJohri:add-half-feature

Conversation

@AlJohri

@AlJohri AlJohri commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add optional half Cargo feature exposing GetSize impls for half::f16 and half::bf16.
  • Both types are 2-byte POD with no heap allocation, so the trait's default get_heap_size_with_tracker (returns 0) is sufficient — matches the pattern used for chrono::NaiveDate etc.

Cross-check

Mirrors the surface used by mem_dbg-rs (impl_size_of!(True; half::f16, half::bf16)): same two types, no SIMD wrappers (f16x4, etc.), heap size = 0.

Test plan

  • cargo test -p get-size2 --features half test_half
  • cargo build -p get-size2 --all-features

@AlJohri AlJohri marked this pull request as ready for review May 14, 2026 19:23
@bircni bircni merged commit 725777b into bircni:main May 15, 2026
6 checks passed
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