Freestanding C runtime functions required by GCC/Clang.
More...
#include <bit>
#include <cstddef>
Go to the source code of this file.
|
| auto | memset (void *dst, int val, std::size_t size) -> void * |
| | Fill memory with byte value.
|
| auto | memcpy (void *dst, const void *src, std::size_t size) -> void * |
| | Copy non-overlapping memory.
|
| auto | memmove (void *dst, const void *src, std::size_t size) -> void * |
| | Copy possibly overlapping memory.
|
| auto | memcmp (const void *lhs, const void *rhs, std::size_t size) -> int |
| | Compare memory.
|
| auto | memchr (const void *src, int val, std::size_t size) -> void * |
| | Find byte value in memory.
|
| auto | strlen (const char *src) -> std::size_t |
| | String length (std::string_view length of C string).
|
Freestanding C runtime functions required by GCC/Clang.
- Date
- 03 Nov 2026
- Copyright
- Copyright (c) 2017 - 2026, Igor Baklykov All rights reserved.
- Author
- Igor Baklykov
Definition in file kLibC.cpp.
◆ IGROS_NO_LIBCALLS
| #define IGROS_NO_LIBCALLS |
◆ memchr()
| IGROS_NO_LIBCALLS auto memchr |
( |
const void * | src, |
|
|
int | val, |
|
|
std::size_t | size )->void * |
Find byte value in memory.
- Parameters
-
| src | Searched memory |
| val | Byte value (converted to unsigned char) |
| size | Number of bytes |
- Returns
- Pointer to first matching byte, nullptr if not found
Definition at line 111 of file kLibC.cpp.
◆ memcmp()
| IGROS_NO_LIBCALLS auto memcmp |
( |
const void * | lhs, |
|
|
const void * | rhs, |
|
|
std::size_t | size )->int |
Compare memory.
- Parameters
-
| lhs | First memory block |
| rhs | Second memory block |
| size | Number of bytes |
- Returns
- Negative, zero or positive: first differing byte (unsigned) of lhs is less, equal or greater
Definition at line 94 of file kLibC.cpp.
◆ memcpy()
| IGROS_NO_LIBCALLS auto memcpy |
( |
void * | dst, |
|
|
const void * | src, |
|
|
std::size_t | size )->void * |
Copy non-overlapping memory.
- Parameters
-
| dst | Destination memory |
| src | Source memory (must not overlap destination) |
| size | Number of bytes |
- Returns
- dst
Definition at line 59 of file kLibC.cpp.
◆ memmove()
| IGROS_NO_LIBCALLS auto memmove |
( |
void * | dst, |
|
|
const void * | src, |
|
|
std::size_t | size )->void * |
Copy possibly overlapping memory.
- Parameters
-
| dst | Destination memory |
| src | Source memory (may overlap destination) |
| size | Number of bytes |
- Returns
- dst
Definition at line 74 of file kLibC.cpp.
◆ memset()
| IGROS_NO_LIBCALLS auto memset |
( |
void * | dst, |
|
|
int | val, |
|
|
std::size_t | size )->void * |
Fill memory with byte value.
- Parameters
-
| dst | Destination memory |
| val | Byte value (converted to unsigned char) |
| size | Number of bytes |
- Returns
- dst
Definition at line 45 of file kLibC.cpp.
◆ strlen()
| IGROS_NO_LIBCALLS auto strlen |
( |
const char * | src | ) |
->std::size_t |
String length (std::string_view length of C string).
- Parameters
-
| src | Null-terminated string |
- Returns
- Number of characters before terminator
Definition at line 127 of file kLibC.cpp.