Lines Matching refs:i
81 for (size_t i = 0; i < alloc_len; i++) { in TEST() local
82 ASSERT_EQ(0, ptr[i]); in TEST()
113 for (size_t i = 0; i <= 12; i++) { in TEST() local
114 for (size_t alignment = 1 << i; alignment < (1U << (i+1)); alignment++) { in TEST()
118 ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptr) % ((1U << i))) in TEST()
153 for (size_t i = 0; i < 100; i++) { in TEST() local
154 ASSERT_EQ(0x23, ptr[i]); in TEST()
161 for (size_t i = 0; i < 200; i++) { in TEST() local
162 ASSERT_EQ(0x45, ptr[i]); in TEST()
169 for (size_t i = 0; i < 250; i++) { in TEST() local
170 ASSERT_EQ(0x67, ptr[i]); in TEST()
186 for (size_t i = 0; i < 100; i++) { in TEST() local
187 ASSERT_EQ(67, ptr[i]); in TEST()
202 for (size_t i = 0; i < 100; i++) { in TEST() local
203 ASSERT_EQ(67, ptr[i]); in TEST()
218 for (size_t i = 0; i < 100; i++) { in TEST() local
219 ASSERT_EQ(0x23, ptr[i]); in TEST()
225 for (size_t i = 0; i < 50; i++) { in TEST() local
226 ASSERT_EQ(0x23, ptr[i]); in TEST()
232 for (size_t i = 0; i < 50; i++) { in TEST() local
233 ASSERT_EQ(0x23, ptr[i]); in TEST()
240 for (size_t i = 0; i < 150; i++) { in TEST() local
241 ASSERT_EQ(0x23, ptr[i]); in TEST()
255 for (size_t i = 0; i < 100; i++) { in TEST() local
256 ASSERT_EQ(0, ptr[i]); in TEST()
270 for (size_t i = 0; i < 100; i++) { in TEST() local
271 ASSERT_EQ(0, ptr[i]); in TEST()
285 for (size_t i = 0; i < 100; i++) { in TEST() local
286 ASSERT_EQ(0, ptr[i]); in TEST()
292 for (size_t i = 0; i < 50; i++) { in TEST() local
293 ASSERT_EQ(0, ptr[i]); in TEST()
299 for (size_t i = 0; i < 50; i++) { in TEST() local
300 ASSERT_EQ(0, ptr[i]); in TEST()
307 for (size_t i = 0; i < 150; i++) { in TEST() local
308 ASSERT_EQ(0, ptr[i]); in TEST()
519 for (size_t i = 0; i < usable_size; i++) { in TEST() local
520 ASSERT_EQ(0, zero_mem[i]) << "Failed at allocation size " << size << " at byte " << i; in TEST()
575 for (size_t i = 0; i < MAX_LOOPS; i++) { in TEST() local
577 filler[i] = malloc(1); in TEST()
578 ASSERT_TRUE(filler[i] != nullptr); in TEST()
580 values_32[i] = reinterpret_cast<uint32_t*>(malloc(sizeof(uint32_t))); in TEST()
581 ASSERT_TRUE(values_32[i] != nullptr); in TEST()
582 *values_32[i] = i; in TEST()
583 ASSERT_EQ(*values_32[i], i); in TEST()
584 ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(values_32[i]) & (sizeof(uint32_t) - 1)); in TEST()
586 free(filler[i]); in TEST()
589 for (size_t i = 0; i < MAX_LOOPS; i++) { in TEST() local
591 filler[i] = malloc(1); in TEST()
592 ASSERT_TRUE(filler[i] != nullptr); in TEST()
594 values_64[i] = reinterpret_cast<uint64_t*>(malloc(sizeof(uint64_t))); in TEST()
595 ASSERT_TRUE(values_64[i] != nullptr); in TEST()
596 *values_64[i] = 0x1000 + i; in TEST()
597 ASSERT_EQ(*values_64[i], 0x1000 + i); in TEST()
598 ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(values_64[i]) & (sizeof(uint64_t) - 1)); in TEST()
600 free(filler[i]); in TEST()
603 for (size_t i = 0; i < MAX_LOOPS; i++) { in TEST() local
605 filler[i] = malloc(1); in TEST()
606 ASSERT_TRUE(filler[i] != nullptr); in TEST()
608 values_ldouble[i] = reinterpret_cast<long double*>(malloc(sizeof(long double))); in TEST()
609 ASSERT_TRUE(values_ldouble[i] != nullptr); in TEST()
610 *values_ldouble[i] = 5.5 + i; in TEST()
611 ASSERT_DOUBLE_EQ(*values_ldouble[i], 5.5 + i); in TEST()
615 ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(values_ldouble[i]) & 0x7); in TEST()
617 ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(values_ldouble[i]) & (sizeof(long double) - 1)); in TEST()
620 free(filler[i]); in TEST()
623 for (size_t i = 0; i < MAX_LOOPS; i++) { in TEST() local
624 free(values_32[i]); in TEST()
625 free(values_64[i]); in TEST()
626 free(values_ldouble[i]); in TEST()
750 for (size_t i = 0; i < kMaxAllocs; i++) { in TEST() local
752 ptrs[i] = malloc(size); in TEST()
753 ASSERT_TRUE(ptrs[i] != nullptr); in TEST()
756 size_t usable_size = malloc_usable_size(ptrs[i]); in TEST()
796 for (size_t i = 0; i < kMaxConsecutiveAllocs; i++) { in TestAllocateType() local
797 types[i] = new Type; in TestAllocateType()
798 VerifyAlignment(types[i]); in TestAllocateType()
803 for (size_t i = 0; i < kMaxConsecutiveAllocs; i++) { in TestAllocateType() local
804 delete types[i]; in TestAllocateType()
808 for (size_t i = 0; i < kMaxConsecutiveAllocs; i++) { in TestAllocateType() local
809 types[i] = reinterpret_cast<Type*>(malloc(sizeof(Type))); in TestAllocateType()
810 ASSERT_TRUE(types[i] != nullptr); in TestAllocateType()
811 VerifyAlignment(types[i]); in TestAllocateType()
816 for (size_t i = 0; i < kMaxConsecutiveAllocs; i++) { in TestAllocateType() local
817 free(types[i]); in TestAllocateType()
822 for (size_t i = 0; i < type_vector.size(); i++) { in TestAllocateType() local
823 VerifyAlignment(&type_vector[i]); in TestAllocateType()
834 for (size_t i = 0; i < sizeof(ptrs) / sizeof(void*); i++) { in AndroidVerifyAlignment() local
835 ptrs[i] = malloc(alloc_size); in AndroidVerifyAlignment()
836 ASSERT_TRUE(ptrs[i] != nullptr); in AndroidVerifyAlignment()
837 ASSERT_EQ(0U, reinterpret_cast<uintptr_t>(ptrs[i]) & mask) in AndroidVerifyAlignment()
839 << alloc_size << " actual ptr " << ptrs[i]; in AndroidVerifyAlignment()
877 for (size_t i = 1; i <= 128; i++) { in TEST() local
878 size_t rounded = (i + 7) & ~7; in TEST()
880 AndroidVerifyAlignment(i, 16); in TEST()
882 AndroidVerifyAlignment(i, 8); in TEST()
904 for (size_t i = 0; i < kNumAllocatingThreads; i++) { in TEST() local
922 for (size_t i = 0; i < kNumForkLoops; i++) { in TEST() local
1072 for (size_t i = 0; i < sizeof(ptrs) / sizeof(void*); i++) { in GetMaxAllocations() local
1073 ptrs[i] = malloc(kAllocationSize); in GetMaxAllocations()
1074 if (ptrs[i] == nullptr) { in GetMaxAllocations()
1075 max_pointers = i; in GetMaxAllocations()
1079 for (size_t i = 0; i < max_pointers; i++) { in GetMaxAllocations() local
1080 free(ptrs[i]); in GetMaxAllocations()
1088 for (size_t i = 0; i < max_pointers; i++) { in VerifyMaxPointers() local
1089 ptrs[i] = malloc(kAllocationSize); in VerifyMaxPointers()
1090 ASSERT_TRUE(ptrs[i] != nullptr) << "Failed to allocate on iteration " << i; in VerifyMaxPointers()
1095 for (size_t i = 0; i < max_pointers; i++) { in VerifyMaxPointers() local
1096 free(ptrs[i]); in VerifyMaxPointers()
1197 for (size_t i = 0; i < kNumThreads; i++) { in SetAllocationLimitMultipleThreads() local
1198 ASSERT_EQ(0, pthread_create(&threads[i], nullptr, SetAllocationLimit, &go)); in SetAllocationLimitMultipleThreads()
1210 for (size_t i = 0; i < kNumThreads; i++) { in SetAllocationLimitMultipleThreads() local
1212 ASSERT_EQ(0, pthread_join(threads[i], &result)); in SetAllocationLimitMultipleThreads()
1229 for (size_t i = 0; i < 100; i++) { in TEST() local