473,382 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

A garbage collector for C/C++ (Hans Boehm)

On Mon, 14 Apr 2008 00:43:31 -0700 (PDT), James Kanze
<ja*********@gmail.comwrote:
>All I can say is that there are a number of users (myself
included) who find the investment worthwhile enough to do it
ourselves. It took me less than a day to get the Boehm
collector up and running with g++ under Linux, and I don't have
access to all of the inside knowledge of the implementors. And
10%, over the life of a project, is a lot more than one man-day,
even for a single project. 10% gain for 90% of the C++ projects
almost certainly adds up to man-years.

Doesn't look that simple to me. I downloaded gc version 6.7 and 6.8.

nmake nodebug=1 gc.mak

makefile(389) : fatal error U1001: syntax error : illegal character
'{' in macro

I then downloaded 7.0 and by using the exact same command as posted
above (no change), it built fine. What a weird error.

Then I added the header file

#include "gc_cpp.h"

Changed the "new" to

Tree *t = new (GCNew) Tree;

cl /O2 -I"\gc-7.0\include" new.cpp "\gc-7.0\Release\gc.lib"

Compiled fine but when I ran the new.exe,

"This application has failed to start because MSVCR90.dll was not
found"

I found the file and put it in the same directory. Next error: An
application has made an error to load the C runtime library
incorrectly."

What the heck.
Jun 27 '08 #1
3 1815
On 2008-04-14 16:36, Razii wrote:
On Mon, 14 Apr 2008 00:43:31 -0700 (PDT), James Kanze
<ja*********@gmail.comwrote:
>>All I can say is that there are a number of users (myself
included) who find the investment worthwhile enough to do it
ourselves. It took me less than a day to get the Boehm
collector up and running with g++ under Linux, and I don't have
access to all of the inside knowledge of the implementors. And
10%, over the life of a project, is a lot more than one man-day,
even for a single project. 10% gain for 90% of the C++ projects
almost certainly adds up to man-years.


Doesn't look that simple to me. I downloaded gc version 6.7 and 6.8.

nmake nodebug=1 gc.mak

makefile(389) : fatal error U1001: syntax error : illegal character
'{' in macro

I then downloaded 7.0 and by using the exact same command as posted
above (no change), it built fine. What a weird error.

Then I added the header file

#include "gc_cpp.h"

Changed the "new" to

Tree *t = new (GCNew) Tree;

cl /O2 -I"\gc-7.0\include" new.cpp "\gc-7.0\Release\gc.lib"

Compiled fine but when I ran the new.exe,

"This application has failed to start because MSVCR90.dll was not
found"

I found the file and put it in the same directory. Next error: An
application has made an error to load the C runtime library
incorrectly."

What the heck.
Did you read README.QUICK and doc/README.win32?

--
Erik Wikström
Jun 27 '08 #2
On Mon, 14 Apr 2008 16:31:16 GMT, Erik Wikström
<Er***********@telia.comwrote:
>Did you read README.QUICK and doc/README.win32?
Yes, I did. Still unable to make it work. GC with compiled language is
not a good idea anyway. There should be a VM (not JVM or CLR but
special VM with JIT compiler designed specifically for C++). GC job
can be handled by VM and people will have a choice to run C++ software
compiled to bytecode (more portable) that runs on a VM.

Jun 27 '08 #3
On Apr 15, 11:23 pm, Razii <DONTwhatever...@hotmail.comwrote:
On Mon, 14 Apr 2008 16:31:16 GMT, Erik Wikström

<Erik-wikst...@telia.comwrote:
Did you read README.QUICK and doc/README.win32?

Yes, I did. Still unable to make it work. GC with compiled language is
not a good idea anyway. There should be a VM (not JVM or CLR but
special VM with JIT compiler designed specifically for C++). GC job
can be handled by VM and people will have a choice to run C++ software
compiled to bytecode (more portable) that runs on a VM.
Use LLVM if you want an (optional) VM. It does just-in-time/ahead-of-
time compilation.
It has a powerful, profile-guided link-time and run-time optimizer and
it uses gcc front end, so compatibility with the standard is pretty
good.
It doesn't have a big user base yet, so it might still have some bugs
and rough edges.

--
gpd
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Pedro Miguel Carvalho | last post by:
Greetings. I'm creating a project that as a intricate relation between object kind of like a set where each object in the set can be connect to a subset of object of the set and objects not in...
10
by: pachanga | last post by:
The Hans-Boehm garbage collector can be successfully used with C and C++, but not yet a standard for C++.. Is there talks about Garbage Collector to become in the C++ standard?
5
by: Ganesh | last post by:
Hi, How does a garbage collector (in C++), like mark and sweep, work on heap allocated arrays? In this case, 1. The only live variable on stack that points to the memory may be the one that...
8
by: HalcyonWild | last post by:
Hi, I installed the free version(command line only) of the digital mars c++ compiler. It said it features a garbage collection mechanism, but there was no documentation. I figured out that...
142
by: jacob navia | last post by:
Abstract -------- Garbage collection is a method of managing memory by using a "collector" library. Periodically, or triggered by an allocation request, the collector looks for unused memory...
3
by: Fab | last post by:
Hi ! Maybe somebody has used a GC - I think to Hans Boehm's one, but other, if any, are welcome -. I need to use a GC in order to program an interpreter for a functional language. Memory...
350
by: Lloyd Bonafide | last post by:
I followed a link to James Kanze's web site in another thread and was surprised to read this comment by a link to a GC: "I can't imagine writing C++ without it" How many of you c.l.c++'ers use...
158
by: pushpakulkar | last post by:
Hi all, Is garbage collection possible in C++. It doesn't come as part of language support. Is there any specific reason for the same due to the way the language is designed. Or it is...
1
by: monalikolhe | last post by:
Hey Guys, I am new to this programming stuff, but i want to try using Hans Boem Garbage Collector (HBGC) as my assignment. I dont know which Compiler to use for it and how to use? Please Help
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.