|
From: Brett v. de S. <bv...@as...> - 2010-03-10 20:47:48
|
>>> OK, I understand that there is no lisp version of free(). >>> However, would it help the garbage collection if I applied >>> something like the following to my session data at the close >>> of a session: >>> >>> (defun dereference (obj) >>> (cond ((consp obj) >>> (dereference (car obj)) >>> (dereference (cdr obj)) >>> (setf (car obj) nil) >>> (setf (cdr ojb) nil)) >>> ;; add similar actions for arrays, structs, etc. >>> )) >> >> To a degree, yes. >> >> Doing it always for everything is almost certainly a bad idea, but >> doing things like CLRHASH for hash-tables or FILL for vectors can be >> worthwhile. >> >> It all depends: if cleaning out pointers means you're writing to >> write-protected pages it is going to be a loss -- but if those pages >> are dirty already, it is probably a win. > >I'm not sure it would help at all. Indeed, dereferencing objects only made the behavior of the garbage collector somewhat worse. Since it does "stop-and-copy" garbage collection steps, cleaning out pointers doesn't help. Brett |