MCPcopy Create free account
hub / github.com/BorrowSanitizer/bsan / bsan_aligned_alloc

Function bsan_aligned_alloc

bsan-rt/llvm-wrapper/bsan_allocator.cpp:240–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238 uptr PageSize = GetPageSizeCached();
239 if (UNLIKELY(CheckForPvallocOverflow(size, PageSize))) {
240 errno = errno_ENOMEM;
241 if (AllocatorMayReturnNull())
242 return nullptr;
243 UNINITIALIZED BufferedStackTrace stack;
244 ReportPvallocOverflow(size, &stack);
245 }
246 // pvalloc(0) should allocate one page.
247 size = size ? RoundUpTo(size, PageSize) : PageSize;
248 return SetErrnoOnNull(BsanAllocate(size, PageSize, false /*zeroise*/));
249}
250
251void *bsan_aligned_alloc(uptr alignment, uptr size) {
252 if (UNLIKELY(!CheckAlignedAllocAlignmentAndSize(alignment, size))) {

Callers 1

INTERCEPTORFunction · 0.85

Calls 1

BsanAllocateFunction · 0.85

Tested by

no test coverage detected