Skip to content

Use typed TArrayUtilities.Fill overloads for byte/word fills#136

Merged
Xor-el merged 1 commit into
masterfrom
refactor/typed-array-fill
Jul 7, 2026
Merged

Use typed TArrayUtilities.Fill overloads for byte/word fills#136
Xor-el merged 1 commit into
masterfrom
refactor/typed-array-fill

Conversation

@Xor-el

@Xor-el Xor-el commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Add a Fill(TCryptoLibInt32Array) overload beside the existing Byte / UInt32 / UInt64 ones, then switch every TArrayUtilities.Fill call in the library to the matching non-generic overload. These map to FillChar / FillDWord / FillQWord (memset) instead of the generic per-element loop and are correct for any filler value, including negative Int32.

Also replace the six FillChar calls that wipe dynamic byte arrays with TArrayUtilities.Fill; the remaining FillChar uses (pointer derefs and fixed arrays/records, which Fill can't take) are left as-is. The generic Fill stays as the fallback for other element types.

Add a Fill(TCryptoLibInt32Array) overload beside the existing Byte /
UInt32 / UInt64 ones, then switch every TArrayUtilities.Fill<T> call in
the library (160 sites: 121 Byte, 16 UInt32, 19 UInt64, 4 Int32) to the
matching non-generic overload. These map to FillChar / FillDWord /
FillQWord (memset) instead of the generic per-element loop and are
correct for any filler value, including negative Int32.

Also replace the six FillChar calls that wipe dynamic byte arrays with
TArrayUtilities.Fill; the remaining FillChar uses (pointer derefs and
fixed arrays/records, which Fill can't take) are left as-is. The generic
Fill<T> stays as the fallback for other element types.
@Xor-el Xor-el merged commit 1804d3d into master Jul 7, 2026
24 checks passed
@Xor-el Xor-el deleted the refactor/typed-array-fill branch July 7, 2026 18:49
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.

1 participant