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
7namespace fl {
8
9
10// Overload for void* to maintain standard memset signature
11inline 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
18template <typename T>
19inline 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
30inline void* memcopy(void* dst, const void* src, fl::size num) {
31 return ::memcpy(dst, src, num);
32}
33
34
35
36} // namespace fl
void * memcopy(void *dst, const void *src, fl::size num)
Definition memfill.h:30
void * memfill(void *ptr, int value, fl::size num)
Definition memfill.h:11
IMPORTANT!
Definition crgb.h:20