rainwoodman / vast

vala and scientific numerical computation
11 stars 1 forks source link

Use a single construct block #30

Closed rainwoodman closed 7 years ago

rainwoodman commented 7 years ago

In a construct block we know the construct setter of attributes have all been called. Thus we initialize the immutable property values.

arteymix commented 7 years ago

Maybe we should wait for adding comments until we commit to something stable. It was a real pain in Valum to update them afterward.

Otherwise everything looks good!

arteymix commented 7 years ago

I'm okay with all this and breaking PyGObject is fine since we'll actively look for a fix.

arteymix commented 7 years ago

Hmm, we could basically avoid summing _baseptr + _offset in Iterator and operate directly on _baseptr. Still, we keep offset for the public eye.

arteymix commented 7 years ago

You're right that there's a lot of _. Maybe we could avoid the getter overhead strictly for critical regions?

Also, it might just be optimized away, although I'm not exactly sure if it's done for public symbols.

rainwoodman commented 7 years ago

I think it is ok for accessing the variables -- because if we define an attribute '' is automatically defined by vala. But the '' prefixed functions are what concerns me. I think we should be able to move the xxx_from_xxx functions for slicing into a single struct. I'll merge this one and deal with that in a new pr.