adammitchelldev / adammitchelldev/le

Display buffer should not be recreated each update

Open
#1 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Currently the display buffer is recreated each update. Kilo's default implementation mallocs a new 0 length buffer, uses realloc *every append* and frees the buffer when it is done.

Ideally, the display updater is passed a buffer that it can overwrite and re-use. The buffer can be longer than required so long as the number of characters to write is tracked and passed into ```write(...)```.

A set-length self-flushing buffer could be used so long as *appends* are partially written if they exceed the buffer limit. Probably needs a unit test.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.