free_list: add an assertion to make sure that the element is not NULL

Link: https://github.com/GeneAssembly/biosal/issues/819
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>
memory_pool: use free lists to track freed pointers

The current code allocates memory to track freed pointers, which is
bad. The memory pool should not allocate any memory except the large blocks.

The free list structure can track freed pointers by storing the
pointers directly in the memory pointed by freed pointers.
This approach requires that pointers point to at least
sizeof(struct core_free_list_element) bytes, which is usually
8 bytes 64-bit systems.

With this approach, the number of calls to malloc was reduced from 87830
to 60478 (-31.14% reduction).

Reduction:
irb(main):002:0> 100.0 * (60478 - 87830) / 87830
=> -31.14197882272572

Before (call count, call distribution by key, size distribution for dominant key):
[boisvert@bigmem biosal]$ grep memory_allocate log|awk '{print $10}'|sort|wc -l
87830
[boisvert@bigmem biosal]$ grep memory_allocate log|awk '{print $10}'|sort|uniq -c|sort -r -n|head
69743 0xc170626e
4559 0x146f7d15
3315 0x2d9d481
3223 0x37ddf367
2800 0x185945f7
1008 0x89e9235d
764 0x46d316e4
532 0x1d4f2792
419 0x9739a8fa
395 0x2ee1c5a6
[boisvert@bigmem biosal]$ grep 0xc170626e log|grep allocate | awk '{print $3}'|sort -n|uniq -c|sort -r -n|head
30109 16368
16283 8
8607 24
3688 1024
3564 3584
2009 48
1051 4
625 16
561 32
447 512

The key 0xc170626e is MEMORY_MEMORY_POOL_NULL_SELF.

After (call count, call distribution by key, size distribution for dominant key):
[boisvert@bigmem biosal]$ grep memory_allocate log|awk '{print $10}'|sort|wc -l
60478
[boisvert@bigmem biosal]$ grep memory_allocate log|awk '{print $10}'|sort|uniq -c|sort -r -n|head
42737 0xc170626e
4542 0x146f7d15
3315 0x2d9d481
3223 0x37ddf367
2800 0x185945f7
1008 0x89e9235d
758 0x46d316e4
523 0x1d4f2792
419 0x9739a8fa
395 0x2ee1c5a6
[boisvert@bigmem biosal]$ grep 0xc170626e log|grep allocate | awk '{print $3}'|sort -n|uniq -c|sort -r -n|head
17117 8
9176 32
3992 64
3904 2048
3724 1024
1884 4
633 16
455 128
449 512
367 32768

The new dominant size is 8 bytes with key 0xc170626e.

Link: https://github.com/GeneAssembly/biosal/issues/819
Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>