Den 02.02.2010 13:00, skrev Schwab,Wilhelm K:
Henry,
I would not toss your first thought too quickly. Staying clear of finalization is a big benefit. I have never been able to trust it (for files) on Dolphin, which has a remarkably better implementation of weak collections and finalization than Squeak/Pharo.
Bill
Stephane's question was not what it should do differently though, but what it did do differently ;) For information: (1 to: 3) collect: [:h | [CompiledMethod allInstancesDo: [:each | each getSourceFromFile]] timeToRun] Standard way, which both registers in the FileRegistry, and does close at end of getSourceFromFile: #(13348 12786 12712) Explicit closing with readOnlyFileNamed:do: #(12091 12061 12189) Considering the amount of work done in reading each source, that's not entirely insignificant, but it requires quite a large amount of additional private protocol in the FileStream classes... Cheers, Henry