added new* functions for types, call memset after malloc to avoid invalid content