finish changes in alloc interface
add tests on alloc