MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / _mi_os_alloc_aligned

Function _mi_os_alloc_aligned

3rd/mimalloc-2.0.9/src/os.c:828–841  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

826}
827
828void* _mi_os_alloc_aligned(size_t size, size_t alignment, bool commit, bool* large, mi_stats_t* tld_stats)
829{
830 MI_UNUSED(&mi_os_get_aligned_hint); // suppress unused warnings
831 MI_UNUSED(tld_stats);
832 if (size == 0) return NULL;
833 size = _mi_os_good_alloc_size(size);
834 alignment = _mi_align_up(alignment, _mi_os_page_size());
835 bool allow_large = false;
836 if (large != NULL) {
837 allow_large = *large;
838 *large = false;
839 }
840 return mi_os_mem_alloc_aligned(size, alignment, commit, allow_large, (large!=NULL?large:&allow_large), &_mi_stats_main /*tld->stats*/ );
841}
842
843/* -----------------------------------------------------------
844 OS aligned allocation with an offset. This is used

Callers 2

mi_reserve_os_memory_exFunction · 0.85

Calls 4

_mi_os_good_alloc_sizeFunction · 0.85
_mi_align_upFunction · 0.85
_mi_os_page_sizeFunction · 0.85
mi_os_mem_alloc_alignedFunction · 0.85

Tested by

no test coverage detected