Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-05-29 05:54:40


Larry Evans wrote:
> Chuck Messenger wrote:
>> The basic idea is to intercept all memory allocations -- p = new X;
>> --
>> saving the info with "map[p] = sizeof(X);". To find the
>> interconnections between objects, you do this:
>>
>> for (map_type::iterator it = map.begin(); it != map.end(); ++it)
>> { char *p = it->first;
>> unsigned size = it->second;
>> for (char *v = p; v + 4 <= p + size; v += 4) {
>> char *q = *(reinterpret_cast<char **>(v));
>> if (map.count(q)) {
>> // connection detected from object p to object q
>> }
>> }
>> }
> This is similar to Mirek Fidler's code:
>
http://groups.google.com/groups?q=OGC2+-+major+improvement+group:comp.lang.c%2B%2B.moderated&hl=en&lr=&ie=UTF-8&group=comp.lang.c%2B%2B.moderated&selm=3DCD36C3.4090502%40nospam_prodigy.net&rnum=1

If by "similar to" you mean "derived from" or "inspired by" (an euphemism
for "plagiarized" or "borrowed" which is itself an e. f. "stolen") then no,
it is not "similar". sp_collector.cpp is written entirely from scratch. It
is not even derived from or inspired by (no quotes) Greg's cyclic_ptr
although of course as the implemented algorithm is basically the same there
are obvious similarities.

FWIW, it is not similar (no quotes) to Mirek Fidler's code, either. I just
checked.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk