Static Memory Area for Garbage Collection

R

R Karthick

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!
 
V

Victor Bazarov

R said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top