Skip to content

baselibc: Add option to disable memset and memcpy#3657

Open
kasjer wants to merge 1 commit into
apache:masterfrom
kasjer:kasjer/baselibc-memcpy-optionl
Open

baselibc: Add option to disable memset and memcpy#3657
kasjer wants to merge 1 commit into
apache:masterfrom
kasjer:kasjer/baselibc-memcpy-optionl

Conversation

@kasjer
Copy link
Copy Markdown
Contributor

@kasjer kasjer commented May 23, 2026

baselibc version of memcpy and memset are optimized for speed if compared to pure C code.
However compiler provided version are more efficient. Additionally baselibc version for ARM copies data
in revers direction which is allowed but may degrade performance when buffers are aligned but number of bytes to copy is not multiply of 4.

Second case where this approach shows it's drawbacks is when memcpy is used to copy data from memory mapped QSPI flash when reading from the last byte is very inefficient.

This just add option to drop baselibc version in favor of other (compiler provided or user provided).

baselibc version of memcpy and memset are optimized
for speed if compared to pure C code.
However compiler provided version are more efficient.
Additionally baselibc version for ARM copies data
in revers direction which is allowed but may degrade
performance when buffers are aligned but number of
bytes to copy is not multiply of 4.

Second case where this approach shows it's drawbacks
is when memcpy is used to copy data from memory mapped
QSPI flash when reading from the last byte is very
inefficient.

This just add option to drop baselibc version in favor
of other (compiler provided or user provided).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant