Added functions to calculate type size in memory