xmem compatable library with autosize features