Test smallest allocation of large type (test_malloc)
authorIvan Maidanski <ivmai@mail.ru>
Mon, 4 Dec 2017 21:08:40 +0000 (00:08 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 22 Dec 2017 07:22:27 +0000 (10:22 +0300)
commit6eb69ca2a45056477d062ba1eb82c3528794d1e7
tree1112416c9fcf77babd962cac8f085d7898af4bbf
parent231065a2f58afa5f20ab92436ae75cd30d44bc6a
Test smallest allocation of large type (test_malloc)
(Cherry-pick commits 29d91db, 937b173 from 'master' branch.)

* src/atomic_ops_malloc.c (AO_malloc_large): Add assertion that the
stored size is greater than LOG_MAX_SIZE.
* src/atomic_ops_malloc.c (AO_malloc): Add assertions for log_size.
* tests/test_malloc.c (LOG_MAX_SIZE, CHUNK_SIZE): New macro (copied
from atomic_ops_malloc.c).
* tests/test_malloc.c (main): Call AO_free(0), AO_malloc(0); add comment.
* tests/test_malloc.c [HAVE_MMAP] (main): Call
AO_malloc(CHUNK_SIZE-sizeof(AO_t)+1).
src/atomic_ops_malloc.c
tests/test_malloc.c