changed calloc calls to ruby alloc macros