Kakadu / lablqml

Interfacing Qt/QML with OCaml. Formely known as lablqt
http://kakadu.github.io/lablqml
GNU Lesser General Public License v2.1
159 stars 17 forks source link

Fixes issues with OCaml's garbage collector #32

Closed ghost closed 7 years ago

ghost commented 7 years ago
Kakadu commented 7 years ago

@orbifx Can you squash this into fewer commits?

ghost commented 7 years ago

Can you use this for now? http://stackoverflow.com/questions/11396069/squash-to-only-one-proper-commit-for-github-pull-request/36377439#36377439

I'll squash future commits before pushing to my master in the future.

Kakadu commented 7 years ago

It seems that we register global root both in caml_create_QQmlPropertyMap and in saveCallback. Is it really required?

Also, mallocing fv in caml_create_QQmlPropertyMap seems really fishy. Can you add some comments why it is needed?

ghost commented 7 years ago

Regarding caml_create_camlpropertymap: Yeah there is probably a duplication of registration. But I think we should go with the one after malloc.

Rergarding mallocing fv: Since we are allocating the PropertyMap using caml_alloc_.. we can't have a registered value within it. It has to be in a memory location not controlled by OCaml's garbage collector.

Kakadu commented 7 years ago

So, you basically want to say that we can't have a global root which is a field of some block in heap?

ghost commented 7 years ago

Correct.