[GAP Forum] Immutable lists and memory usage

Keshav Rao Kini krkini at ntu.edu.sg
Tue Feb 8 03:35:22 GMT 2011


Hello,

Here is the result of some experimentation I did:

gap> x := [];; for i in [1..100] do Add(x, i); od; MemoryUsage(x); MakeImmutable(x);; MemoryUsage(x); ShrinkAllocationPlist(x); MemoryUsage(x);
512
512
416

I'm wondering why ShrinkAllocationPlist isn't called automatically by MakeImmutable, since once I use MakeImmutable() it should be impossible to extend x or even to shrink it, if I understand correctly...

-Keshav

Disclaimer: the boilerplate text at the foot of this email has been added automatically by my mail server. This was not done by my request (rather the opposite) so please disregard it.


________________________________
CONFIDENTIALITY: This email is intended solely for the person(s) named and may be confidential and/or privileged. If you are not the intended recipient, please delete it, notify us and do not copy, use, or disclose its content. Thank you.

Towards A Sustainable Earth: Print Only When Necessary


More information about the Forum mailing list