<div dir="ltr"><div>Roman, maybe you could use iem16? <br><br><a href="https://git.iem.at/pd/iem16">https://git.iem.at/pd/iem16</a> says that it is "16bit storage for Pd"<br><br></div>looking at the helpfile of [table16] we read:<br><br><div>"[table16] stores 16bit values. The normal pd-tables ([table], array) store the values as floating-points. While floating points are (often) more precise (this is of course not really true..., esp. when comparing integer(4byte) to floating-point.) they use a lot of memory (4byte).</div><div><br></div><div>[table16] uses only 16bit (2bytes) to store the values, which is half of the memory."<br><br></div><div>So maybe it is exactly what you need?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em qua., 12 de jan. de 2022 às 11:57, Christof Ressi <<a href="mailto:info@christofressi.com">info@christofressi.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> I read<br>
> once in IRC that one value in a Pd-array requires not 4 bytes, but 8<br>
> bytes on 64-bit systems.<br>
Yes. Pd's graphical arrays (and Pd's data structure arrays in general) <br>
are implemented as a linear array of "words" (t_word). A "word" can hold <br>
one of several possible types. It is implemented as a C union, so the <br>
overall size is always that of the largest member. In our case, the <br>
largest member is a pointer (e.g. t_symbol *), which is 4 bytes on a <br>
32-bit system and 8 bytes on a 64-bit systems.<br>
<br>
This means that even if you would add a "byte" type, the overall size of <br>
"t_word" would stay the same.<br>
<br>
However, you can always implement your own byte array object as an <br>
external. But as you noted, this is not necessary except you're on a <br>
very tight memory and/or CPU budget.<br>
<br>
Christof<br>
<br>
On 12.01.2022 14:20, Roman Haefeli wrote:<br>
> Hi<br>
><br>
> Sometimes I stored byte data (lists of bytes) in arrays. IIRC, I read<br>
> once in IRC that one value in a Pd-array requires not 4 bytes, but 8<br>
> bytes on 64-bit systems. Since storing plain bytes seems not such an<br>
> uncommon use case for me, I wonder if it can be done more efficiently.<br>
> Not that I ever hit a memory limit, I'm just curious. With the new<br>
> (amazing!) [file] object, dealing with byte lists has become even more<br>
> appealing, so the desire to store them in memory increases.<br>
><br>
><br>
> Roman<br>
><br>
><br>
><br>
> _______________________________________________<br>
> <a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
> UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
<br>
<br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at" target="_blank">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" rel="noreferrer" target="_blank">https://lists.puredata.info/listinfo/pd-list</a><br>
</blockquote></div>