FastLED
3.9.15
Loading...
Searching...
No Matches
memfill.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
string.h
>
// for standard memset fallback
4
5
#include "
fl/int.h
"
6
7
namespace
fl
{
8
9
10
// Overload for void* to maintain standard memset signature
11
inline
void
*
memfill
(
void
* ptr,
int
value, fl::size num) {
12
return ::memset(ptr, value, num);
13
}
14
15
16
// fl::memfill - provides a FastLED-specific memfill implementation
17
// that is compatible across all supported platforms
18
template
<
typename
T>
19
inline
void
*
memfill
(T* ptr,
int
value, fl::size num) {
20
union
memfill_union {
// For type aliasing safety.
21
T* ptr;
22
void
* void_ptr;
23
};
24
memfill_union u;
25
u.ptr = ptr;
26
return
fl::memfill
(u.void_ptr, value, num);
27
}
28
29
30
inline
void
*
memcopy
(
void
* dst,
const
void
* src, fl::size num) {
31
return ::memcpy(dst, src, num);
32
}
33
34
35
36
}
// namespace fl
int.h
fl::memcopy
void * memcopy(void *dst, const void *src, fl::size num)
Definition
memfill.h:30
fl::memfill
void * memfill(void *ptr, int value, fl::size num)
Definition
memfill.h:11
fl
IMPORTANT!
Definition
crgb.h:20
string.h
fl
memfill.h
Generated on Fri Aug 22 2025 20:59:33 for FastLED by
1.13.2