Add mmap pages stats (disabled by default)
Stats can be enabled by changing #if 0 to #if 1.
Stats are printed at the end, when mmap block is being unmapped, but the print_pages_stats can be called at any time between mmap and munmap.
I was just interested to see the stats for my setup after short inference. Not surprisingly 99% pages are resident even after generating 32 tokens.
Feel free to close without merging, if you think this is not very useful.
mincore is not in POSIX, so in POSIX it is impossible to check if mincore exists. I do not recommend to add this to this project. Btw Warning: mincore() is not specified in POSIX.1-2001, and it is not available on all UNIX implementations. From: https://linux.die.net/man/2/mincore