vmem: implementation of vmem_freespace()