edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Chris Brannon <chris@the-brannons.com>
To: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] gc
Date: Sat, 04 Jan 2014 14:42:03 -0800	[thread overview]
Message-ID: <87bnzr2wuc.fsf@mushroom.PK5001Z> (raw)
In-Reply-To: <20140004171414.eklhad@comcast.net> (Karl Dahlke's message of "Sat, 04 Jan 2014 17:14:14 -0500")

Karl Dahlke <eklhad@comcast.net> writes:

> I have always wondered about gc in c++.

C++ doesn't have true GC.  What it has is deterministic destruction of
objects.  You can use objects to manage resources (such as heap), that
will be reclaimed when the object goes out of scope or is destroyed via
the "delete" operator.
In C++, it's called RAII, short for "resource acquisition is
initialization".  Turns out that you can do some really fancy stuff like
ref-counted smart pointers that free the associated memory when the last
referencing object goes away.  This isn't true GC, but it gets you some
of the benefits.

-- Chris

  reply	other threads:[~2014-01-04 22:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-04 22:14 Karl Dahlke
2014-01-04 22:42 ` Chris Brannon [this message]
2014-01-04 22:52 ` Adam Thompson
2014-01-05  7:30 Karl Dahlke
2014-01-05 13:46 ` Adam Thompson
2014-01-05 19:52   ` Adam Thompson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bnzr2wuc.fsf@mushroom.PK5001Z \
    --to=chris@the-brannons.com \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).