top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

C: How to implement garbage collector in C language ?

+1 vote
485 views

JVM provides garbage collector. Can we do in C ? And what are the efficient ways to implement it in C lang ?

posted Jun 4, 2014 by Vimal Kumar Mishra

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Garbage collector in C++ is known as smart pointers.

I don't think it is possible with c language as it is using template and class to free memory. There are some libraries which provides C programs to garbage collection capabilities.

The BDW(The Boehm-Demers-Weiser GC) library is a freely available. The BDW collector comes as a static or dynamic library and is installed easily by downloading the corresponding package.

answer Jun 5, 2014 by anonymous
Similar Questions
+4 votes

How to implement least recent use for the numbers displayed on phone screen ??

+2 votes

In linux system how can I implement a linklist to communicate between two processes?

+4 votes

Say you have only this structure only to implement Doubly LL

struct Node
{
   int val;
   Node* p;
};
...