User: Password:
|
|
Subscribe / Log in / New account

allocation in C

allocation in C

Posted Jun 20, 2010 20:13 UTC (Sun) by nix (subscriber, #2304)
In reply to: allocation in C by tialaramex
Parent article: The Managed Runtime Initiative

In some places the reason I don't use a GC is because I'm lazy and there wasn't one sat there ready to go. It is possible that I should learn to use the Boehm GC in these cases and that I should evangelise its use.
Since using the boehm GC in its simplest form consists of including one header and instantly all your malloc()s are garbage-collected, that's not hard. (You don't need to take the free()s out, but they're no longer *necessary*, merely hints that this block no longer needs to be scanned for possible pointers.)

But yes, avoiding C for the boring stuff is probably best. Embed a better language (or embed the C in a better language) and use that, and get GC for free :)


(Log in to post comments)

allocation in C

Posted Jun 21, 2010 0:33 UTC (Mon) by khc (guest, #45209) [Link]

Or with LD_PRELOAD ;-) It's hard to decide which one is simpler though.

allocation in C

Posted Jun 21, 2010 20:54 UTC (Mon) by nix (subscriber, #2304) [Link]

I suppose it depends if you have the source to all the bits or not. If you do, using LD_PRELOAD would be just icky. If you don't, it's unavoidable.


Copyright © 2018, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds