SmalltalkImage >> #useUpMemoryWithTinyObjects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

SmalltalkImage >> #useUpMemoryWithTinyObjects

Frank Shearar-3
Is there any particular reason why this method makes new BitBlt
instances, as opposed to Object instances? Would it still perform its
purpose if I changed

(1 to: 10000) collect: [:i | BitBlt new]

to

(1 to: 10000) collect: [:i | Object new]

?

This way I can remove one strand of the System -> Graphics dependency.
(It might not _ever_ go away, but you know, one strand at a time...)

frank

Reply | Threaded
Open this post in threaded view
|

Re: SmalltalkImage >> #useUpMemoryWithTinyObjects

timrowledge

On 07-12-2013, at 2:15 PM, Frank Shearar <[hidden email]> wrote:

> Is there any particular reason why this method makes new BitBlt
> instances, as opposed to Object instances? Would it still perform its
> purpose if I changed
>
> (1 to: 10000) collect: [:i | BitBlt new]
>
> to
>
> (1 to: 10000) collect: [:i | Object new]

well a BitBLT is a small object but not as small as a plain Object. You might consider ‘OrderedCollection new:10’ for a similar size

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: BW: Branch on Whim