emacs-devel
[Top][All Lists]
Advanced

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

Re: Quesition about Lisp_Vector


From: Stephen J. Turnbull
Subject: Re: Quesition about Lisp_Vector
Date: Sun, 13 Nov 2011 00:45:29 +0900

Eli Zaretskii writes:

 > Having string data accessible through indirection allows to relocate
 > strings without affecting callers who have references to Lisp strings
 > in local variables.  (This is similar to the ability to relocate
 > buffer text, because buffer text is also accessed through
 > indirection.)

The implementation is similar, but the rationale is not.  Buffers
cannot be allocated by the s[1] trick, because they could not grow
bigger than the allocated size (except by reallocating the buffer
metadata along with the final array, but then how would you deal with
fixing up references?)

 > These abilities are important, because strings, like buffers, can
 > be large, so being able to relocate them during GC helps making
 > more efficient use of the available memory.

I wonder if the problem is not more that there are so many of them
allocated and deallocated, leading to fragmentation, rather than the
size.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]