在OSX(Boehm的垃圾收集器)上安装libgc [英] Installing libgc on OSX (Boehm's Garbage Collector)

查看:59
本文介绍了在OSX(Boehm的垃圾收集器)上安装libgc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从在我正在制作的库中使用引用计数开始.这是一个相当不错的解决方案,增量和减量不会浪费很多资源,因为有些人似乎错误地认为.另外,用于引用计数的少量额外内存也可以忽略不计.

I've started by using reference counting in my library I'm making. It's a pretty decent solution and the increments and decrements don't waste many resources as some people wrongly seem to think. Also the slight extra memory for reference counts is negligible.

但是,显然跟踪垃圾回收是如此之好,以至于它比使用malloc/free更好.我不确定这是否是真的,所以我想尝试一下(通过一次释放多个对象进行后端优化?).另外,由于不需要调用保留/释放函数,GC可以使我的库更易于使用.

But apparently tracing garbage collection is so good that it is better than using malloc/free. I'm not sure if this is true so I'd like to try it out (Back-end optimisations by freeing multiple objects at once?). Also GC would make my library easier to use, as calling retain/release functions is not needed.

问题是gc/gc.h无限地包含了它自己.这是没有道理的...

The problem is that gc/gc.h includes itself infinitely. This makes no sense...

谢谢.

推荐答案

问题相当模糊.您是否想知道一般如何使用libgc,还是想在Mac OS X上使其正常工作?如果以后是这种情况,那么我建议使用Homebrew.它具有libgc相当不错的公式.只需使用命令:

The question is rather vague. do you want to know how to use libgc in general or do you want to know how to get it working on mac OS X? if later is the case then I recommend using Homebrew. It has a pretty decent formula for libgc. just use the command:

brew install libgc

这将根据HomeBrew公式中可用的最新版本将库安装在/usr/local/Cellar/libgc/7.6.0 中.

this will install the library in /usr/local/Cellar/libgc/7.6.0 depending on the latest version available in HomeBrew formula.

您对gc.h无限地指称自己的困惑实际上是不正确的.因为在第一个gc.h所包含的gc子文件夹中还有另一个gc.h.我不知道为什么他们如此设计它!

the confusion you have regarding gc.h referring to itself infinitively is actually not true. because there is another gc.h in the gc subfolder which the first gc.h is including. I have no idea why they have designed it like this though!

这篇关于在OSX(Boehm的垃圾收集器)上安装libgc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆