As the title states, which method is recommended to calculate the size
assuming types are non -zero copy hence alignment calculation is not needed or is the type aligned per say
in this situation which method is preferred and why ? i have seen people saying to not use sizeof i dont understand what is the harm in it except for paying rent for a few more bytes.
Update : mem::sizeof also takes into account the padding done to align the struct, if so manually calculating the individual sizes and summing it up is wrong is it not ? but almost every program i read seems to do it manually if so why is it not necessary to take into account the padding added while coming up with the final size
further question :Also if i have type like Option how is the size calculated ? 1 for Option + 1 for Enum +1 if it has simple fields ? or the 1 allocated for Enum Covers it ?