MCPcopy Create free account
hub / github.com/ThePhD/sol2 / align_user

Function align_user

include/sol/stack_core.hpp:211–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209
210 template <typename T>
211 void* align_user(void* ptr) {
212 typedef std::integral_constant<bool,
213#if SOL_IS_OFF(SOL_ALIGN_MEMORY)
214 false
215#else
216 (std::alignment_of_v<T> > 1)
217#endif
218 >
219 use_align;
220 if (!use_align::value) {
221 return ptr;
222 }
223 std::size_t space = (std::numeric_limits<std::size_t>::max)();
224 return align(std::alignment_of_v<T>, ptr, space);
225 }
226
227 template <typename T>
228 T** usertype_allocate_pointer(lua_State* L) {

Callers

nothing calls this directly

Calls 1

alignFunction · 0.85

Tested by

no test coverage detected