MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / is_aligned_to

Function is_aligned_to

system/lib/libcxx/src/memory_resource.cpp:33–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31
32#if !_LIBCPP_HAS_ALIGNED_ALLOCATION
33static bool is_aligned_to(void* ptr, size_t align) {
34 void* p2 = ptr;
35 size_t space = 1;
36 void* result = std::align(align, 1, p2, space);
37 return (result == ptr);
38}
39#endif
40
41class _LIBCPP_HIDDEN __new_delete_memory_resource_imp : public memory_resource {

Callers 1

do_allocateFunction · 0.85

Calls 1

alignFunction · 0.85

Tested by

no test coverage detected