Home
last modified time | relevance | path

Searched refs:alloc_size (Results 1 – 25 of 185) sorted by relevance

12345678

/external/cronet/base/allocator/partition_allocator/shim/
Dallocator_shim_default_dispatch_to_partition_alloc_unittest.cc111 constexpr size_t alloc_size = 100; in TEST() local
112 void* data = PartitionCalloc(nullptr, 1, alloc_size, nullptr); in TEST()
115 char* zeroes[alloc_size]; in TEST()
116 memset(zeroes, 0, alloc_size); in TEST()
118 EXPECT_EQ(0, memcmp(zeroes, data, alloc_size)); in TEST()
123 constexpr size_t alloc_size = 100; in TEST() local
125 void* data = PartitionMemalign(nullptr, alignment, alloc_size, nullptr); in TEST()
132 for (size_t alloc_size : {100, 100000, 10000000}) { in TEST()
137 PartitionAlignedAlloc(nullptr, alloc_size, alignment, nullptr); in TEST()
146 for (size_t alloc_size : {100, 100000, 10000000}) { in TEST()
[all …]
/external/linux-kselftest/tools/testing/selftests/vm/
Dmlock-random-test.c138 int test_mlock_within_limit(char *p, int alloc_size) in test_mlock_within_limit() argument
147 if (cur.rlim_cur < alloc_size) { in test_mlock_within_limit()
149 alloc_size, (unsigned int)cur.rlim_cur); in test_mlock_within_limit()
162 int lock_size = rand() % alloc_size; in test_mlock_within_limit()
163 int start_offset = rand() % (alloc_size - lock_size); in test_mlock_within_limit()
174 p, alloc_size, in test_mlock_within_limit()
190 if (locked_vm_size > PAGE_ALIGN(alloc_size, page_size) + page_size) { in test_mlock_within_limit()
192 locked_vm_size, alloc_size); in test_mlock_within_limit()
215 int test_mlock_outof_limit(char *p, int alloc_size) in test_mlock_outof_limit() argument
223 if (cur.rlim_cur >= alloc_size) { in test_mlock_outof_limit()
[all …]
/external/cronet/buildtools/third_party/libc++/trunk/benchmarks/
Dallocation.bench.cpp66 const size_t alloc_size = st.range(0); in BM_AllocateAndDeallocate() local
68 void* p = AllocWrapper::Allocate(alloc_size); in BM_AllocateAndDeallocate()
70 AllocWrapper::Deallocate(p, alloc_size); in BM_AllocateAndDeallocate()
77 const size_t alloc_size = st.range(0); in BM_AllocateOnly() local
81 PointerList* p = (PointerList*)AllocWrapper::Allocate(alloc_size); in BM_AllocateOnly()
91 AllocWrapper::Deallocate(Tmp, alloc_size); in BM_AllocateOnly()
97 const size_t alloc_size = st.range(0); in BM_DeallocateOnly() local
102 p = AllocWrapper::Allocate(alloc_size); in BM_DeallocateOnly()
108 AllocWrapper::Deallocate(*Data, alloc_size); in BM_DeallocateOnly()
/external/virglrenderer/src/
Dvrend_strbuf.h41 size_t alloc_size; member
80 sb->alloc_size = initial_size; in strbuf_alloc()
92 sb->alloc_size = size; in strbuf_alloc_fixed()
106 if (sb->size + len + 1 > sb->alloc_size) { in strbuf_grow()
116 size_t new_size = MAX2(sb->size + len + 1, sb->alloc_size + STRBUF_MIN_MALLOC); in strbuf_grow()
123 sb->alloc_size = new_size; in strbuf_grow()
149 int len = vsnprintf(sb->buf + sb->size, sb->alloc_size - sb->size, fmt, ap); in strbuf_vappendf()
150 if (len >= (int)(sb->alloc_size - sb->size)) { in strbuf_vappendf()
154 vsnprintf(sb->buf + sb->size, sb->alloc_size - sb->size, fmt, cp); in strbuf_vappendf()
175 int len = vsnprintf(sb->buf, sb->alloc_size, fmt, ap); in strbuf_vfmt()
[all …]
/external/rust/crates/grpcio-sys/grpc/src/core/lib/gprpp/
Darena.cc40 size_t alloc_size = base_size + initial_size; in ArenaStorage() local
46 return gpr_malloc_aligned(alloc_size, alignment); in ArenaStorage()
68 size_t alloc_size) { in CreateWithAlloc() argument
72 new (ArenaStorage(initial_size)) Arena(initial_size, alloc_size); in CreateWithAlloc()
92 size_t alloc_size = zone_base_size + size; in AllocZone() local
93 Zone* z = new (gpr_malloc_aligned(alloc_size, GPR_MAX_ALIGNMENT)) Zone(); in AllocZone()
/external/cronet/base/trace_event/
Dtrace_arguments.cc145 void StringStorage::Reset(size_t alloc_size) { in Reset() argument
146 if (!alloc_size) { in Reset()
150 } else if (!data_ || alloc_size != data_->size) { in Reset()
151 data_ = static_cast<Data*>(::realloc(data_, sizeof(size_t) + alloc_size)); in Reset()
152 data_->size = alloc_size; in Reset()
261 size_t alloc_size = 0; in CopyStringsTo() local
264 alloc_size += in CopyStringsTo()
267 alloc_size += GetAllocLength(names_[n]); in CopyStringsTo()
273 alloc_size += GetAllocLength(values_[n].as_string); in CopyStringsTo()
276 if (alloc_size) { in CopyStringsTo()
[all …]
/external/libcups/examples/
Dppdx.c55 size_t alloc_size; /* Allocated size of data buffer */ in ppdxReadData() local
83 alloc_size = 256; in ppdxReadData()
129 if (alloc_size < 2048) in ppdxReadData()
130 temp_size = alloc_size * 2; in ppdxReadData()
131 else if (alloc_size < PPDX_MAX_DATA) in ppdxReadData()
132 temp_size = alloc_size + 2048; in ppdxReadData()
143 decomp.avail_out = temp_size - alloc_size; in ppdxReadData()
145 alloc_size = temp_size; in ppdxReadData()
/external/compiler-rt/lib/asan/tests/
Dasan_oob_test.cc81 for (size_t alloc_size = 1; alloc_size <= 8; alloc_size++) { in TEST() local
83 void *p = malloc(alloc_size); in TEST()
87 if (offset + access_size <= alloc_size) { in TEST()
90 int outside_bytes = offset > alloc_size ? (offset - alloc_size) : 0; in TEST()
/external/libdrm/tests/amdgpu/
Dcs_tests.c214 req.alloc_size = 4*1024; in amdgpu_cs_uvd_create()
285 req.alloc_size = 4*1024; /* msg */ in amdgpu_cs_uvd_decode()
286 req.alloc_size += 4*1024; /* fb */ in amdgpu_cs_uvd_decode()
288 req.alloc_size += 4096; /*it_scaling_table*/ in amdgpu_cs_uvd_decode()
289 req.alloc_size += ALIGN(sizeof(uvd_bitstream), 4*1024); in amdgpu_cs_uvd_decode()
290 req.alloc_size += ALIGN(dpb_size, 4*1024); in amdgpu_cs_uvd_decode()
291 req.alloc_size += ALIGN(dt_size, 4*1024); in amdgpu_cs_uvd_decode()
300 req.alloc_size, 1, 0, &va, in amdgpu_cs_uvd_decode()
304 r = amdgpu_bo_va_op(buf_handle, 0, req.alloc_size, va, 0, in amdgpu_cs_uvd_decode()
406 r = amdgpu_bo_va_op(buf_handle, 0, req.alloc_size, va, 0, AMDGPU_VA_OP_UNMAP); in amdgpu_cs_uvd_decode()
[all …]
/external/mesa3d/src/util/
Dos_memory_aligned.h74 size_t alloc_size; in os_malloc_aligned() local
83 if (add_overflow_size_t(size, alignment, &alloc_size) || in os_malloc_aligned()
84 add_overflow_size_t(alloc_size, sizeof(void *), &alloc_size)) { in os_malloc_aligned()
88 ptr = (char *) os_malloc(alloc_size); in os_malloc_aligned()
/external/virglrenderer/src/mesa/util/
Dos_memory_aligned.h74 size_t alloc_size; in os_malloc_aligned() local
83 if (add_overflow_size_t(size, alignment, &alloc_size) || in os_malloc_aligned()
84 add_overflow_size_t(alloc_size, sizeof(void *), &alloc_size)) { in os_malloc_aligned()
88 ptr = (char *) os_malloc(alloc_size); in os_malloc_aligned()
/external/tensorflow/tensorflow/core/common_runtime/gpu/
Dpool_allocator_test.cc133 int64_t alloc_size = 0; in TEST() local
135 [&alloc_count, &alloc_size](void* ptr, int numa_node, int64_t size) { in TEST()
137 alloc_size += size; in TEST()
156 EXPECT_EQ(0, alloc_size); in TEST()
169 EXPECT_EQ(16 + (alloc_count * kChunkPrefixSize), alloc_size); in TEST()
181 EXPECT_EQ(16 + (alloc_count * kChunkPrefixSize), alloc_size); in TEST()
196 EXPECT_EQ(16 + 4 + 2 + (alloc_count * kChunkPrefixSize), alloc_size); in TEST()
206 EXPECT_EQ(16 + 4 + 2 + (alloc_count * kChunkPrefixSize), alloc_size); in TEST()
223 EXPECT_EQ(16 + 4 + 2 + (alloc_count * kChunkPrefixSize), alloc_size); in TEST()
233 EXPECT_EQ(16 + 4 + 2 + (alloc_count * kChunkPrefixSize), alloc_size); in TEST()
/external/cronet/base/process/
Dmemory.cc35 const size_t alloc_size = num_items * size; in UncheckedCalloc() local
38 if (size && ((alloc_size / size) != num_items)) { in UncheckedCalloc()
43 if (!UncheckedMalloc(alloc_size, result)) in UncheckedCalloc()
46 memset(*result, 0, alloc_size); in UncheckedCalloc()
/external/jemalloc_new/test/unit/
Dpages.c4 size_t alloc_size; in TEST_BEGIN() local
8 alloc_size = HUGEPAGE * 2 - PAGE; in TEST_BEGIN()
10 pages = pages_map(NULL, alloc_size, PAGE, &commit); in TEST_BEGIN()
21 pages_unmap(pages, alloc_size); in TEST_BEGIN()
/external/libchrome/base/process/
Dmemory.cc37 const size_t alloc_size = num_items * size; in UncheckedCalloc() local
40 if (size && ((alloc_size / size) != num_items)) { in UncheckedCalloc()
45 if (!UncheckedMalloc(alloc_size, result)) in UncheckedCalloc()
48 memset(*result, 0, alloc_size); in UncheckedCalloc()
/external/tensorflow/tensorflow/core/framework/
Dcpu_allocator_impl.cc89 const std::size_t alloc_size = port::MallocExtension_GetAllocatedSize(p); in AllocateRaw() local
92 stats_.bytes_in_use += alloc_size; in AllocateRaw()
96 std::max<int64_t>(stats_.largest_alloc_size, alloc_size); in AllocateRaw()
106 AddTraceMe("MemoryAllocation", p, num_bytes, alloc_size); in AllocateRaw()
114 const std::size_t alloc_size = in DeallocateRaw() local
117 stats_.bytes_in_use -= alloc_size; in DeallocateRaw()
118 AddTraceMe("MemoryDeallocation", ptr, 0, alloc_size); in DeallocateRaw()
/external/virglrenderer/tests/
Dtest_virgl_strbuf.c36 ck_assert_int_eq(sb.alloc_size, 1024); in START_TEST()
93 ck_assert_int_eq(sb.alloc_size, 128 + STRBUF_MIN_MALLOC); in START_TEST()
113 ck_assert_int_eq(sb.alloc_size, 2048); in START_TEST()
114 ck_assert_int_ge(sb.alloc_size, strbuf_get_len(&sb) + 1); in START_TEST()
133 ck_assert_int_eq(sb.alloc_size, 128); in START_TEST()
134 ck_assert_int_ge(sb.alloc_size, strbuf_get_len(&sb) + 1); in START_TEST()
155 ck_assert_int_ge(sb.alloc_size, strbuf_get_len(&sb) + 1); in START_TEST()
156 ck_assert_int_gt(sb.alloc_size, 1024); in START_TEST()
/external/linux-kselftest/tools/testing/selftests/powerpc/stringloops/
Dmemcmp.c76 unsigned long i, comp_size, alloc_size; in testcase() local
81 alloc_size = comp_size + MAX_OFFSET_DIFF_S1_S2; in testcase()
89 s1 = p + MAP_SIZE - alloc_size; in testcase()
90 s2 = p + 3 * MAP_SIZE - alloc_size; in testcase()
104 for (j = 0; j < alloc_size; j++) in testcase()
130 for (j = 0; j < alloc_size; j++) in testcase()
/external/libdrm/amdgpu/
Damdgpu_bo.c62 bo->alloc_size = size; in amdgpu_bo_create()
78 args.in.bo_size = alloc_buffer->alloc_size; in amdgpu_bo_alloc()
92 r = amdgpu_bo_create(dev, alloc_buffer->alloc_size, args.out.handle, in amdgpu_bo_alloc()
162 info->alloc_size = bo_info.bo_size; in amdgpu_bo_query_info()
256 uint64_t alloc_size = 0; in amdgpu_bo_import() local
313 output->alloc_size = bo->alloc_size; in amdgpu_bo_import()
327 alloc_size = open_arg.size; in amdgpu_bo_import()
347 alloc_size = dma_buf_size; in amdgpu_bo_import()
356 r = amdgpu_bo_create(dev, alloc_size, handle, &bo); in amdgpu_bo_import()
370 output->alloc_size = bo->alloc_size; in amdgpu_bo_import()
[all …]
/external/libwebsockets/lib/misc/lwsac/
Dlwsac.c84 if (bf->alloc_size - bf->ofs < lwsac_align(amount)) in lwsac_extend()
114 if (bf->alloc_size - bf->ofs >= ensure) in _lwsac_use()
125 if (bf->alloc_size - bf->ofs >= ensure) in _lwsac_use()
181 bf->alloc_size = alloc; in _lwsac_use()
195 if (bf->ofs >= bf->alloc_size) in _lwsac_use()
196 bf->ofs = bf->alloc_size; in _lwsac_use()
242 overhead += (head->alloc_size - head->ofs) + sizeof(*head); in lwsac_total_overhead()
/external/boringssl/src/crypto/buf/
Dbuf.c99 size_t alloc_size = n * 4; in BUF_MEM_reserve() local
100 if (alloc_size / 4 != n) { in BUF_MEM_reserve()
105 char *new_buf = OPENSSL_realloc(buf->data, alloc_size); in BUF_MEM_reserve()
111 buf->max = alloc_size; in BUF_MEM_reserve()
/external/rust/crates/quiche/deps/boringssl/src/crypto/buf/
Dbuf.c101 size_t alloc_size = n * 4; in BUF_MEM_reserve() local
102 if (alloc_size / 4 != n) { in BUF_MEM_reserve()
108 char *new_buf = OPENSSL_realloc(buf->data, alloc_size); in BUF_MEM_reserve()
115 buf->max = alloc_size; in BUF_MEM_reserve()
/external/cronet/third_party/boringssl/src/crypto/buf/
Dbuf.c99 size_t alloc_size = n * 4; in BUF_MEM_reserve() local
100 if (alloc_size / 4 != n) { in BUF_MEM_reserve()
105 char *new_buf = OPENSSL_realloc(buf->data, alloc_size); in BUF_MEM_reserve()
111 buf->max = alloc_size; in BUF_MEM_reserve()
/external/strace/tests-m32/
Dtail_alloc.c37 const size_t alloc_size = len + 6 * page_size; in tail_alloc() local
39 void *p = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, in tail_alloc()
42 perror_msg_and_fail("mmap(%zu)", alloc_size); in tail_alloc()
/external/strace/tests/
Dtail_alloc.c37 const size_t alloc_size = len + 6 * page_size; in tail_alloc() local
39 void *p = mmap(NULL, alloc_size, PROT_READ | PROT_WRITE, in tail_alloc()
42 perror_msg_and_fail("mmap(%zu)", alloc_size); in tail_alloc()

12345678