471,078 Members | 778 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,078 software developers and data experts.

Static Memory Area for Garbage Collection

Hi,

I am in the process of designing a conservative garbage collector for C
++.

As one of the requirement of conservative garbage collection, I will
have to scan through the static memory area and look for probable
pointers into the heap.

I am stuck in the implementation part, where I am not very sure on
which physical address the static elements are stored for X86
machines. Is the address of the static area stored in some processor
register? If yes how can I access it in a C++ program?

Thanks!

Oct 30 '07 #1
3 1432
R Karthick wrote:
I am in the process of designing a conservative garbage collector for
C ++.

As one of the requirement of conservative garbage collection, I will
have to scan through the static memory area and look for probable
pointers into the heap.

I am stuck in the implementation part, where I am not very sure on
which physical address the static elements are stored for X86
machines. Is the address of the static area stored in some processor
register? If yes how can I access it in a C++ program?
The boilerplate answer is "you cannot". C++ has no concept of "X86".
It has no concept of accessible (for scanning) "static memory area".
All of those things are compiler- and platform-specific and should be
asked about in the newsgroup specialising in your particular platform
and compiler.

There are several commercial implementations of garbage-collecting
memory managers on the market. Perhaps you should give those a look.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Oct 30 '07 #2
Victor Bazarov wrote:
There are several commercial implementations of garbage-collecting
memory managers on the market. Perhaps you should give those a look.
Just for completeness, there's also the free Boehm GC, which claims
(some) support for C++. I've never tried it myself, though.

http://www.hpl.hp.com/personal/Hans_Boehm/gc/
Nov 30 '07 #3
On Nov 30, 4:51 pm, Matthias Buelow <m...@incubus.dewrote:
Victor Bazarov wrote:
There are several commercial implementations of garbage-collecting
memory managers on the market. Perhaps you should give those a look.
Just for completeness, there's also the free Boehm GC, which claims
(some) support for C++. I've never tried it myself, though.
http://www.hpl.hp.com/personal/Hans_Boehm/gc/
Actually, it has very good support for C++. I've used it, at
least with g++ under Linux, and it works quite well.

--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Nov 30 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Chris Bardon | last post: by
4 posts views Thread by Rick | last post: by
8 posts views Thread by Adrian | last post: by
9 posts views Thread by Chuck Cobb | last post: by
81 posts views Thread by Peter Olcott | last post: by
12 posts views Thread by Nehil | last post: by
2 posts views Thread by Jack Jackson | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.