Skip to content

Commit

Permalink
Add debugging information to debug travis failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jun 4, 2019
1 parent 15841f4 commit bc8b220
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cont.c
Expand Up @@ -185,7 +185,8 @@ fiber_pool_expand(struct fiber_pool * fiber_pool, size_t size, size_t count)
allocation->base = NULL;
allocation->size = size;
allocation->count = count;


fprintf(stderr, "\nfiber_pool_expand: %p, %zu x [%zu]\n", fiber_pool, count, size);

#ifdef _WIN32
DWORD old_protect;
Expand Down Expand Up @@ -330,7 +331,7 @@ fiber_pool_stack_acquire(struct fiber_pool * fiber_pool) {

fiber_pool_stack_reset(&vacancy->stack);

// printf("\nfiber_pool_stack_acquire: %p, next=%p\n", vacancy->stack.base, fiber_pool->vacancies);
fprintf(stderr, "\nfiber_pool_stack_acquire: %p, next=%p\n", vacancy->stack.base, fiber_pool->vacancies);

return vacancy->stack;
}
Expand All @@ -341,13 +342,13 @@ fiber_pool_stack_release(struct fiber_pool_stack stack) {

// Using madvise can make physical memory available to OS when there is memory pressure.
// But bencmarks show that this approach makes performance worse.
// madvise(vacancy->stack.base, vacancy->stack.size - RB_PAGE_SIZE, MADV_FREE);
madvise(vacancy->stack.base, vacancy->stack.size - RB_PAGE_SIZE, MADV_FREE);

vacancy->stack = stack;
vacancy->next = stack.pool->vacancies;
stack.pool->vacancies = vacancy;

// printf("\nfiber_pool_stack_release: %p\n", vacancy->stack.base);
fprintf(stderr, "\nfiber_pool_stack_release: %p\n", vacancy->stack.base);
}

static COROUTINE
Expand Down

0 comments on commit bc8b220

Please sign in to comment.