rs: repurpose reed_solomon_init() to initialize static buffer #5
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-sleepybishop/nanors!5
Loading…
Reference in a new issue
No description provided.
Delete branch "reed_solomon_init"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
nanors only uses the heap in
reed_solomon_new()to allocate a context struct.If we don't want to use the heap at all (only use static allocation) we can also provide that buffer and initialize it with the context.
The most natural name for this would be
reed_solomon_init()but this function already exists - turns out it's a no-op.So instead of coming up with a new function name, I decided to repurposed
reed_solomon_init()for this.Thank you for the PR. When I first wrote this, I used the same interface as
https://github.com/moonlight-stream/moonlight-common-c/blob/master/reedsolomon/rs.h
In that implementation,
reed_solomon_init()is used to precalculate the lookup tables for finite field multiplication. That is not required in nanors so it became a no-op to maintain compatibility which I'd prefer to retain.Would you consider something along the lines of
reed_solomon_alloc()?Hm but the function does not do any allocating - how about
reed_solomon_new_static()orreed_solomon_new_with_buf()?Sure, I don't really have a preference,
reed_solomon_prepare()might also work, up to you. My main interest is in retaining compatibility with the existing interface.Thank you!