Am 12.04.2007 um 04:00 schrieb Guyren Howe:
>>> ...The original question was about speed. This is fast because  
>>> you don't
>>> have to shift or even remove elements. You just move the head and
>>> tail pointers around and reuse the elements of the array. You could
>>> just naively use the array, rediming and whatever you want to. But
>>> this will be hundreds of times faster than that.
>>>
>> Ahhhh, ok. See, now that I've had a day of colas and naps while
>> commuting, I finally understand. I didn't realize you were talking
>> about
>> just re-using the elements, but instead had imagined that you were
>> speaking of still reading and removing elements.
>>
>> That's really handy. I vaguely recall doing something like that  
>> with a
>> bitfield in C/C++, but it had faded way into the background to join
>> other concepts I'd learned and never used enough.
>
> Worth mentioning also: you didn't say what you were keeping in the
> array.

I (the OP) am just keeping doubles or integers there - so the  
question was just about avoiding to shuffle values around in the array.

> Oh, and note this: you can implement the reuse thing by having the
> objects put themselves into a pool array in their destructor. By
> doing that, there is a reference to them again, and they won't get
> reclaimed. I recently checked this with Mars, and he said that this
> would work just fine.

Now that's an interesting sidenote...

Do I understand this correctly - you can prevent an object from being  
destroyed when the destructor is already executed? Hm. Interesting  
concept. Offers a lot of possibilities.

Would that mean the the Destructor will be called again when the last  
reference is dropped again afterwards?

Thanks,
    Frank+++


--

Günter Schmidt GmbH
Frank Bitterlich             eMail: [EMAIL PROTECTED]
Ben-Gurion-Ring 21           WWW:   http://www.gsco.de/
D-60437 Frankfurt            Tel.:  069 / 156809-29
GERMANY                      Fax:   069 / 156809-28
Geschäftsführer: Jürgen Hartwich
AG Frankfurt am Main, HRB 76504 - USt.-ID: DE235219624




_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to