Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to test error paths for when mmap() fails #29

Open
kuszmaul opened this issue Jun 8, 2015 · 0 comments
Open

Need to test error paths for when mmap() fails #29

kuszmaul opened this issue Jun 8, 2015 · 0 comments

Comments

@kuszmaul
Copy link
Owner

kuszmaul commented Jun 8, 2015

We put in some nontrivial code. Need to make sure that all the error paths actually work.

Here's the call chain. We want to make sure that all these functions, at all their call sites, actually call their error-handling code.

mmap_size called by
chunk_create_slow (returns 0 on error)
mmap_chunk_aligned_block (returns 0)

chunk_create_slow called by
mmap_chunk_aligned_block (returns 0)

mmap_chunk_aligned_block called by
get_power_of_two_chunks (returns 0)
large_malloc (returns 0)
initialize_malloc (aborts on a problem)
small_malloc (returns 0)

get_power_of_two_chunks called by
huge__malloc (returns null)

large_malloc
cached_malloc (returns NULL)

initialize_malloc (aborts on problem)

small_malloc called by
cached_malloc (returns NULL)

huge_malloc called by
malloc (returns NULL)
aligned_malloc_internal (returns NULL)

cached_malloc
malloc (returns NULL)
aligned_malloc_internal (returns NULL)

aligned_malloc_internal
aligned_malloc (returns NULL)
posix_memalign (some fancy footwork on the error to return the right value)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant