Re: [Vala] memory management with structs (OT a bit)



2013/5/18 Donn <donn ingle gmail com>

On 18/05/2013 13:40, Jonas Kulla wrote:

no, compact classes are even simpler than non-Gobject classes. The
latter still have reference count and can be extended, whereas
compact classes are mostly "classified" structs without ref count
which also cannot be extended in subclasses.

Okay, but did that answer the question? I'm not sure.

It was:

 You can use classes that don't inherit from GObject, which are
lighter.

Are such classes the:
A) [Compact] classes
or
B) is any class that does not specify a parent class automatically a
"light" class?


I'm pretty sure he was simply referring to B. As he mentioned,
compact classes aren't exactly meant to be used in newly written
Vala code, but rather exist to make the writing of bindings easier.

i.e. How do you create a class that does *not* inherit from GObject?


By not specifying a parent class, ie. just "class MyKlass { ... }".

Jonas


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]