Branch Coverage

deps/libgit2/src/util/pool.c
Criterion Covered Total %
branch 32 66 48.4


line true false branch
30 0 87 if (git__page_size(&system_page_size) < 0)
39 0 3902 GIT_ASSERT_ARG(pool);
40 0 3902 GIT_ASSERT_ARG(item_size >= 1);
53 1286 4377 for (scan = pool->pages; scan != NULL; scan = next) {
67 0 1286 if (GIT_ADD_SIZET_OVERFLOW(&alloc_size, new_page_size, sizeof(git_pool_page)) ||
0 1286 if (GIT_ADD_SIZET_OVERFLOW(&alloc_size, new_page_size, sizeof(git_pool_page)) ||
85 2743 1286 if (!page || page->avail < size)
0 2743 if (!page || page->avail < size)
98 0 0 for (scan = pool->pages; scan != NULL; scan = scan->next) ct++;
105 0 0 for (scan = pool->pages; scan != NULL; scan = scan->next)
106 0 0 if ((void *)scan->data <= ptr &&
0 0 if ((void *)scan->data <= ptr &&
170 0 4 if (a == b)
182 1204 2825 if (pool->item_size > 1) {
199 502 0 if (ptr)
208 0 1378 GIT_ASSERT_ARG_WITH_RETVAL(pool, NULL);
209 0 1378 GIT_ASSERT_ARG_WITH_RETVAL(str, NULL);
210 0 1378 GIT_ASSERT_ARG_WITH_RETVAL(pool->item_size == sizeof(char), NULL);
212 0 1378 if (n == SIZE_MAX)
215 1378 0 if ((ptr = git_pool_malloc(pool, (n + 1))) != NULL) {
225 0 596 GIT_ASSERT_ARG_WITH_RETVAL(pool, NULL);
226 0 596 GIT_ASSERT_ARG_WITH_RETVAL(str, NULL);
227 0 596 GIT_ASSERT_ARG_WITH_RETVAL(pool->item_size == sizeof(char), NULL);
234 8 0 return str ? git_pool_strdup(pool, str) : NULL;
242 0 6 GIT_ASSERT_ARG_WITH_RETVAL(pool, NULL);
243 0 6 GIT_ASSERT_ARG_WITH_RETVAL(pool->item_size == sizeof(char), NULL);
245 6 0 len_a = a ? strlen(a) : 0;
246 6 0 len_b = b ? strlen(b) : 0;
248 0 6 if (GIT_ADD_SIZET_OVERFLOW(&total, len_a, len_b) ||
0 6 if (GIT_ADD_SIZET_OVERFLOW(&total, len_a, len_b) ||
252 6 0 if ((ptr = git_pool_malloc(pool, total)) != NULL) {
253 6 0 if (len_a)
255 6 0 if (len_b)