struct A {
var a:Int = 2
func f()->Int {
return 2*a
}
}
var obj = A()
obj.f()
Size of obj is 8 bytes. And if I add new properties the size will be changed. It's fine.
I would like to know how compiler takes care about function's memory. No matter there is func in the struct or not, the size is the same. But func is information as well and I guess it should take memory as well(maybe I am wrong). So how that process is going on?
I would be so appreciated if you recommend me subject name so I can read.
Thanks