Branch Coverage

deps/libgit2/src/pool.c
Criterion Covered Total %
branch 34 68 50.0


line true false branch
28 27 3965 if (!size) {
30 0 27 if (git__page_size(&page_size) < 0)
42 0 3992 assert(pool);
43 0 3992 assert(item_size >= 1);
56 1298 4466 for (scan = pool->pages; scan != NULL; scan = next) {
70 0 1298 if (GIT_ADD_SIZET_OVERFLOW(&alloc_size, new_page_size, sizeof(git_pool_page)) ||
0 1298 if (GIT_ADD_SIZET_OVERFLOW(&alloc_size, new_page_size, sizeof(git_pool_page)) ||
88 2778 1298 if (!page || page->avail < size)
0 2778 if (!page || page->avail < size)
101 0 0 for (scan = pool->pages; scan != NULL; scan = scan->next) ct++;
108 0 0 for (scan = pool->pages; scan != NULL; scan = scan->next)
109 0 0 if ((void *)scan->data <= ptr &&
0 0 if ((void *)scan->data <= ptr &&
168 0 4 if (a == b)
180 1204 2872 if (pool->item_size > 1) {
197 502 0 if (ptr)
206 1404 0 assert(pool && str && pool->item_size == sizeof(char));
1404 0 assert(pool && str && pool->item_size == sizeof(char));
0 1404 assert(pool && str && pool->item_size == sizeof(char));
208 0 1404 if (n == SIZE_MAX)
211 1404 0 if ((ptr = git_pool_malloc(pool, (n + 1))) != NULL) {
221 610 0 assert(pool && str && pool->item_size == sizeof(char));
610 0 assert(pool && str && pool->item_size == sizeof(char));
0 610 assert(pool && str && pool->item_size == sizeof(char));
227 8 0 return str ? git_pool_strdup(pool, str) : NULL;
235 6 0 assert(pool && pool->item_size == sizeof(char));
0 6 assert(pool && pool->item_size == sizeof(char));
237 6 0 len_a = a ? strlen(a) : 0;
238 6 0 len_b = b ? strlen(b) : 0;
240 0 6 if (GIT_ADD_SIZET_OVERFLOW(&total, len_a, len_b) ||
0 6 if (GIT_ADD_SIZET_OVERFLOW(&total, len_a, len_b) ||
244 6 0 if ((ptr = git_pool_malloc(pool, total)) != NULL) {
245 6 0 if (len_a)
247 6 0 if (len_b)