[squeak-dev] Image stops responding Form>>copyWithColorsReducedTo:

Marcel Taeumel marcel.taeumel at hpi.de
Wed Jun 29 12:40:07 UTC 2022


Hi Karl --

In a 64-bit image, that algorithm tries to allocate about 35 GiB of memory. CMD+Dot will not work because we are sitting in a primitive during that allocation.

I think that Form >> #copyWithColorsReducedTo: was originally (2001) used to reduce colors in 16-bit forms or maybe 8-bit forms, given a 32-bit image.

(1 << 32) * 8. "34 359 738 368 bytes"
(1 << 32) * 4. "17 179 869 184 bytes"
(1 << 16) * 4. "262 144 bytes"
(1 << 8 )* 4. "1024 bytes"

We cannot #collect: this:

(1 to: 1 << 32) collect: [:ea | ...].

:-)

In #copyWithColorsReducedTo: it looks like that we expect a color map. In 32-bit forms, there is no color map. Maybe we should move this algorithm down to ColorForm? See its class comment.

Best,
Marcel
Am 28.06.2022 22:49:43 schrieb karl ramberg <karlramberg at gmail.com>:
Hi,

If I do Form>>copyWithColorsReducedTo:256 on any form the image stops responding.
No debug log.


This is on a updated Trunk image.

I'm on a Windows machine.

Best,
Karl


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220629/e67960cf/attachment.html>


More information about the Squeak-dev mailing list