MCPcopy Create free account
hub / github.com/FastLED/FastLED / operator new

Function operator new

src/fl/stl/shared_ptr.h:121–124  ·  view source on GitHub ↗

Aligned operator new/delete: when T has alignment > default new alignment (e.g. FL_ALIGNAS(64)), plain `new` won't honour it on pre-C++17 compilers. GCC emits -Waligned-new in that case. These overrides route through fl::aligned_alloc / fl::aligned_free so the block is always properly aligned.

Source from the content-addressed store, hash-verified

119 // GCC emits -Waligned-new in that case. These overrides route through
120 // fl::aligned_alloc / fl::aligned_free so the block is always properly aligned.
121 static void* operator new(fl::size_t size) FL_NOEXCEPT {
122 constexpr fl::size_t align = control_block_alignment<T>::value;
123 return fl::aligned_alloc(align, size);
124 }
125 static void operator delete(void* ptr) {
126 fl::aligned_free(ptr);
127 }

Callers

nothing calls this directly

Calls 1

aligned_allocFunction · 0.85

Tested by

no test coverage detected