.net - Does c# have inner class extra overhead? -
i have following simple class:
class stack { public class node // inner class { string item; node next; } }
a stack n
items uses: 8 bytes (reference string)
+ 8 bytes (reference node)
+ 16 bytes (sync block index + type object pointer)
. wonder inner class overhead. need add 8 bytes
? stack n items uses ~ 40*n bytes or ~32*n bytes?
c# inner classes not have hidden reference instance of outer class java
it. if want behavior can create manually. there nothing in c#.
an inner class has different access rules , differently structured name. also, inner classes share generic type parameters of outer class might create overhead. it's organization concept (in c#).
Comments
Post a Comment