简体   繁体   English

与Boehm-Demers-Weiser-Gc一起使用QT

[英]Using QT with Boehm-Demers-Weiser-Gc

Is it possible to use Qt with BDW-GC? Qt可以与BDW-GC一起使用吗? I know that Qt has a sophisticated System for memory management, but parts of my implementation will use a GC anyway, so it would be convenient to not bother and always use it. 我知道Qt有一个复杂的内存管理系统,但是我的实现的部分内容还是会使用GC,因此不打扰并且始终使用它会很方便。

As far as I read, one problem could be that Qt has specific destructors which must be called when an object is freed. 据我所读,一个问题可能是Qt具有特定的析构函数,在释放对象时必须调用这些析构函数。 So I would probably have to register finalizers manually, which call the destructors. 因此,我可能不得不手动注册终结器,这些终结器称为析构函数。

Anyway, I haven't found much info on using Qt with BDW-GC. 无论如何,我还没有找到有关将Qt与BDW-GC一起使用的更多信息。 This is why I am asking. 这就是为什么我要问。

This will not be fun. 这不会很有趣。 C++ programs and Qt is no exception use destructors not only for freeing memory, but also for other jobs, see for example into QMutexLocker. C ++程序和Qt也不例外地使用析构函数,不仅用于释放内存,还用于其他作业,例如参见QMutexLocker。 You will have to do a lot of porting. 您将不得不进行很多移植。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM