lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


In a nutshell, my question is this: If I put lots of nils into a long
array, will the table move its elements to the hash part to save memory?

I'm implementing the Sieve of Eratosthenes. I have a table with indexes
2 through a length parameter all set to true, where the length is rarely
more than 1000, but it could be any positive integer. I then set most of
the indexes to false.

If I use nil instead of false, will it save memory, or will the array
allocation stay the same?

Luther