standard library in the spirit of xmalloc