fixed mem alloc for long types