Added spec and doc for alloc, dealloc and return.