From: Francis Leboutte

Subject: Re: memory

Date: 1997-9-12 10:31

At 08:40 12/09/97 -0400, Wheeler Ruml wrote:
>> Basically I need to represent a mapping from the set of the n first >> positive integers to itself, with n ~= (expt 10 6). I have try with >> an hash-table and with an array, but I run out of memory.
> >An array of the integers between 0-1,000,000 shouldn't be hard to >handle. You should tell MAKE-ARRAY that you want to store small >integers (called 'fixnums', since they use only a fixed number of >bits). So you would say: > >(make-array (expt 10 6) :element-type 'fixnum) > >This means that when you store a number into the array, Lisp won't >create an extra 'box' to go around the number, reminding itself what >type that element is, since it is certainly a fixnum. Not having all >those boxes around should save you some memory.
With ACL4w fixnums are coded in 16 bits: USER<219> most-positive-fixnum 32767 USER<220> Francis -- Francis Leboutte, Algorithme, Rue de la Charrette 141, 4130 Tilff, Belgium <skynet.be at f.leboutte> <acm.org at leboutte> http://users.skynet.be/algo t&fax: +32-(0)4-388.35.28 Support the anti-spam movement; see <http://www.cauce.org/>