Lines Matching defs:stack

58                                u32 tid, u32 stack) {
61 context += stack;
66 u32 &tid, u32 &stack) {
68 stack = context;
122 void SetAllocContext(u32 tid, u32 stack) {
123 AtomicContextStore(&alloc_context_id, tid, stack);
126 void GetAllocContext(u32 &tid, u32 &stack) const {
127 AtomicContextLoad(&alloc_context_id, tid, stack);
135 void SetFreeContext(u32 tid, u32 stack) {
136 AtomicContextStore(&free_context_id, tid, stack);
139 void GetFreeContext(u32 &tid, u32 &stack) const {
140 AtomicContextLoad(&free_context_id, tid, stack);
212 QuarantineCallback(AllocatorCache *cache, BufferedStackTrace *stack)
214 stack_(stack) {
517 bool UpdateAllocationStack(uptr addr, BufferedStackTrace *stack) {
524 m->SetAllocContext(t ? t->tid() : kMainTid, StackDepotPut(*stack));
529 void *Allocate(uptr size, uptr alignment, BufferedStackTrace *stack,
536 ReportRssLimitExceeded(stack);
539 CHECK(stack);
576 ReportAllocationSizeTooBig(size, needed_size, malloc_limit, stack);
593 ReportOutOfMemory(size, stack);
610 m->SetAllocContext(t ? t->tid() : kMainTid, StackDepotPut(*stack));
666 BufferedStackTrace *stack) {
672 ReportInvalidFree(ptr, old_chunk_state, stack);
684 void QuarantineChunk(AsanChunk *m, void *ptr, BufferedStackTrace *stack) {
688 m->SetFreeContext(t ? t->tid() : 0, StackDepotPut(*stack));
694 quarantine.Put(GetQuarantineCache(ms), QuarantineCallback(ac, stack), m,
699 quarantine.Put(&fallback_quarantine_cache, QuarantineCallback(ac, stack),
705 BufferedStackTrace *stack, AllocType alloc_type) {
717 ReportFreeNotMalloced(p, stack);
733 if (!AtomicallySetQuarantineFlagIfAllocated(m, ptr, stack)) return;
737 !IsAllocDeallocMismatchSuppressed(stack)) {
738 ReportAllocTypeMismatch((uptr)ptr, stack, (AllocType)m->alloc_type,
747 ReportNewDeleteTypeMismatch(p, delete_size, delete_alignment, stack);
755 QuarantineChunk(m, ptr, stack);
758 void *Reallocate(void *old_ptr, uptr new_size, BufferedStackTrace *stack) {
768 void *new_ptr = Allocate(new_size, 8, stack, FROM_MALLOC, true);
772 ReportInvalidFree(old_ptr, chunk_state, stack);
778 Deallocate(old_ptr, 0, 0, stack, FROM_MALLOC);
783 void *Calloc(uptr nmemb, uptr size, BufferedStackTrace *stack) {
787 ReportCallocOverflow(nmemb, size, stack);
789 void *ptr = Allocate(nmemb * size, 8, stack, FROM_MALLOC, false);
797 void ReportInvalidFree(void *ptr, u8 chunk_state, BufferedStackTrace *stack) {
799 ReportDoubleFree((uptr)ptr, stack);
801 ReportFreeNotMalloced((uptr)ptr, stack);
804 void CommitBack(AsanThreadLocalMallocStorage *ms, BufferedStackTrace *stack) {
806 quarantine.Drain(GetQuarantineCache(ms), QuarantineCallback(ac, stack));
877 void Purge(BufferedStackTrace *stack) {
883 stack));
889 stack));
938 u32 stack = 0;
939 chunk_->GetAllocContext(tid, stack);
947 u32 stack = 0;
948 chunk_->GetFreeContext(tid, stack);
958 u32 stack = 0;
959 chunk_->GetAllocContext(tid, stack);
960 return stack;
967 u32 stack = 0;
968 chunk_->GetFreeContext(tid, stack);
969 return stack;
993 instance.CommitBack(this, &stack);
1000 void asan_free(void *ptr, BufferedStackTrace *stack, AllocType alloc_type) {
1001 instance.Deallocate(ptr, 0, 0, stack, alloc_type);
1005 BufferedStackTrace *stack, AllocType alloc_type) {
1006 instance.Deallocate(ptr, size, alignment, stack, alloc_type);
1009 void *asan_malloc(uptr size, BufferedStackTrace *stack) {
1010 return SetErrnoOnNull(instance.Allocate(size, 8, stack, FROM_MALLOC, true));
1013 void *asan_calloc(uptr nmemb, uptr size, BufferedStackTrace *stack) {
1014 return SetErrnoOnNull(instance.Calloc(nmemb, size, stack));
1018 BufferedStackTrace *stack) {
1023 ReportReallocArrayOverflow(nmemb, size, stack);
1025 return asan_realloc(p, nmemb * size, stack);
1028 void *asan_realloc(void *p, uptr size, BufferedStackTrace *stack) {
1030 return SetErrnoOnNull(instance.Allocate(size, 8, stack, FROM_MALLOC, true));
1033 instance.Deallocate(p, 0, 0, stack, FROM_MALLOC);
1039 return SetErrnoOnNull(instance.Reallocate(p, size, stack));
1042 void *asan_valloc(uptr size, BufferedStackTrace *stack) {
1044 instance.Allocate(size, GetPageSizeCached(), stack, FROM_MALLOC, true));
1047 void *asan_pvalloc(uptr size, BufferedStackTrace *stack) {
1053 ReportPvallocOverflow(size, stack);
1058 instance.Allocate(size, PageSize, stack, FROM_MALLOC, true));
1061 void *asan_memalign(uptr alignment, uptr size, BufferedStackTrace *stack,
1067 ReportInvalidAllocationAlignment(alignment, stack);
1070 instance.Allocate(size, alignment, stack, alloc_type, true));
1073 void *asan_aligned_alloc(uptr alignment, uptr size, BufferedStackTrace *stack) {
1078 ReportInvalidAlignedAllocAlignment(size, alignment, stack);
1081 instance.Allocate(size, alignment, stack, FROM_MALLOC, true));
1085 BufferedStackTrace *stack) {
1089 ReportInvalidPosixMemalignAlignment(alignment, stack);
1091 void *ptr = instance.Allocate(size, alignment, stack, FROM_MALLOC, true);
1105 ReportMallocUsableSizeNotOwned((uptr)ptr, &stack);
1195 u32 stack = 0;
1196 m->GetAllocContext(tid, stack);
1197 return stack;
1253 ReportSanitizerGetAllocatedSizeNotOwned(ptr, &stack);
1271 instance.Purge(&stack);
1276 return instance.UpdateAllocationStack((uptr)addr, &stack);