[Glass] Alternative commitOnAlmostOutOfMemoryDuring: ?

Mariano Martinez Peck marianopeck at gmail.com
Fri Dec 6 09:41:04 PST 2013


Guys,

I find #commitOnAlmostOutOfMemoryDuring:  very useful but it has the
drawback that it might now commit (if there wasn't an almost out of memory
exception).
So I was thinking a variant that does:

commitOnAlmostOutOfMemoryDuring: aBlock

self almostOutOfMemoryStaticHandlerInstalled
ifTrue: [ ^aBlock value ].
[
self installAlmostOutOfMemoryStaticHandler: 75.
aBlock value.
                *System commitTransaction.*
 ]
ensure: [ self uninstallAlmostOutOfMemoryStaticHandler ]


Notice the added       *System commitTransaction.*

would that be useful ?

-- 
Mariano
http://marianopeck.wordpress.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20131206/73ad3e54/attachment.html>


More information about the Glass mailing list