Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

memcpy: implement #161

Closed
wants to merge 2 commits into from
Closed

Conversation

indrora
Copy link
Contributor

@indrora indrora commented Jun 18, 2015

Implement a basic memcpy, not much to say here.

Signed-off-by: Morgan Gangwere [email protected]

Implement a basic memcpy, not much to say here.

Signed-off-by: Morgan Gangwere <[email protected]>
@indrora
Copy link
Contributor Author

indrora commented Jun 18, 2015

see #130 -> fixes?

@indrora
Copy link
Contributor Author

indrora commented Jun 18, 2015

depends on #160 -> I use a static p_mutex_t to make sure memory calls are done synchronously.

@indrora
Copy link
Contributor Author

indrora commented Jun 18, 2015

You're correct -- I made the (bad) assumption that dst > src in all cases.

Bad assertion logic would have caused a problem if `dst < src`
in debug builds. This logic would have also caused a problem
if the flag FAIL_FAST was defined at compile-time.

This should probably be wrapped in a macro (or some such) that
checks that the bounds are correct. Multiple asserts in the non
fail-fast variant are cleaner, but may or may not be optimized
out when gcc comes along and tries to run "basic" optimizations.

Signed-off-by: Morgan Gangwere <[email protected]>
@indrora indrora closed this Apr 19, 2022
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.

2 participants