Re: boolean sequence

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Thu, 02 Sep 2004 08:58:10 -0700
Tone _koda <guest at RapidEuphoria.com> wrote:

>=20
>=20
> posted by: Tone =8Akoda <tskoda at email.si>
>=20
> in C++ if you have an array of 100 boolean (0 or 1) values it will take o=
nly 100 bits (the C++ "bitset" class exists), in euphoria same array will t=
ake 32*100bits, 32x more memory. so if you have very large array, there is =
big difference between 1 MB and 32 MB. 1 MB will quickly allocate, 32 MB wi=
ll take long to allocate.
>=20
> does in euphoria exist any such library? similar library could exist for =
array with char types (8bit) (0-255 numbers), and array with short types (1=
6bit) (0 to 65,535 numbers).
>=20
> i want such library to save memory and also maybe speed.

Well using sequence bits will be stored as bytes instead of bits, so the be=
st way would be to allocate 13 bytes (8*13 = 104 bits) and making your ow=
n routines to handle them.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu