Tiny/Small C++ libraries

Jonathan M Davis jmdavisProg at gmx.com
Sun Aug 5 17:19:06 PDT 2012


On Monday, August 06, 2012 02:11:14 Andrej Mitrovic wrote:
> I need some relatively small C++ libraries to test my wrapper
> codegenerator. Unfortunately anything big (like WX or even DMD as a
> lib) won't work because I get out of memory errors when compiling the
> D wrapper. Speaking of which, how can I debug/fix this? It seems like
> a front-end issue because it happens with both all-at-once compilation
> and by using -c. I can't tell whether it's caused by cyclic imports,
> or template instantiations, or something else.
> 
> Some hobby C++ libraries would be a great start since they're usually
> small. I could have a look at github as well..
> 
> Otherwise, I'll have to implement a system to filter out symbols which
> won't be wrapped (by using a dependency tree so the wrapper still
> remains compilable), which should generate less code and maybe avoid
> the out of memory issues. But that's only a temporary solution and I
> really need to figure out how to solve the out of memory bug

You could use a profiling tool such as google perf tools to see what's using 
the memory in the compiler, but that would require figuring out what the 
allocations in the compier are associated with in your source code, which 
wouldn't necessarily be easy.

>  (and DMD really needs to learn to release memory on time..).

Last I heard, it never releases _any_ memory, and the one attempt to fix that 
via a garbage collector tanked performance. It _is_ something that needs to be 
sorted out one of these days though.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list