Add an element count to write-array
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 64/100
Research direction
Start from the write-array definition in the ffi namespace and the typed write functions it sits beside, since the issue points to coffi's write-doubles as the model for a count argument. Add the optional trailing n after offset so that only the first n elements are written, and check the existing write-array tests still pass with the old arity. Done when a test writes a partly filled buffer with n and the bytes beyond n are left untouched.
Written by the indexing model from the issue text.
Description
write-array writes all of arr. A staging buffer sized for the largest frame and filled part way has to be copied into a smaller array before the write, which is the allocation the staging buffer exists to avoid.
Proposed, as a trailing argument after offset:
(write-array p t arr offset n) ; writes the first n elements of arr
coffi's write-doubles and the other typed writes take a count. Raised in the jolt discussion on jolt-lang/jolt#1338, from gameth's call sites.
- Dominant language
- Clojure
- Stars
- 25
- Forks
- 3
- Avg merge
- 1m
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from babashka/ffi
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nextjournal/clerk#830 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
IOP tokens release blocker team qa team qa autotests WG adoption
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
penpot/penpot#13540 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
izhangzhihao/intellij-rainbow-brackets#2903 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100