Skip to content

Instantly share code, notes, and snippets.

@bzgnyc
bzgnyc / memcpys.c
Last active November 6, 2024 01:36
Library of inline-able memcpy() routines optimized for low latency copies of small data structures (e.g. small character strings)
/*
This is a library of memcpy() routines similar to the memcpy(3) defined
in the Standard C Library with the exception that they doesn't return the
pointer to 'dst' as per the standard. I have not found value in that
functionality and dropped it. Outside of that limitation, these routines
are a drop-in replacement for memcpy(3).
The value of these routines is making quick copies of small data structures
such as character strings. The goal is inline-able routines optimized
for low latency copies ranging from 1-63 bytes.