garbage-collect is an interactive built-in function in `C source
code'.
(garbage-collect)
Reclaim storage for Lisp objects no longer needed.
Garbage collection happens automatically if you cons more than
`gc-cons-threshold' bytes of Lisp data since previous garbage collection.
`garbage-collect' normally returns a list with info on amount of space in use,
where each entry has the form (NAME SIZE USED FREE), where:
- NAME is a symbol describing the kind of objects this entry represents,
- SIZE is the number of bytes used by each one,
- USED is the number of those objects that were found live in the heap,
- FREE is the number of those objects that are not live but that Emacs
keeps around for future allocations (maybe because it does not know how
to return them to the OS).
However, if there was overflow in pure space, `garbage-collect'
returns nil, because real GC can't be done.
See Info node `(elisp)Garbage Collection'.
[back]
dashboardパースペクティブを起動しようとしたら、以下のエラーが発生しました。
対象環境について
当方の環境は、Ubuntu12.04のEmacs24.3.1です。 Emacsは、以下の手順でインストールしたと記憶してます。
原因について
調べると、どうも
garbage-collect
の戻り値が実装されているロジックの想定と異なるようです。 当方では、以下のような値が返ってきます。また、
(describe-function 'garbage-collect)
で得られたドキュメントは以下です。修正内容について
当環境向けに、
garbage-collect
をパースする関数を別途用意しています。 この修正により、当環境ではdashboardパースペクティブが正常に開けていると感じています。ただ、
e2wm:dp-dashboard-parse-garbage-collect
の実装は、暫定的な感じです。 とりあえずは、パースする関数の候補を1つずつ試していって、要素全て数値の結果が得られたら、 それを採用してます。 また、ここでエラーが発生してしまうと、popwin.elとかのウィンドウ分割機能も動作しなくなってしまいました。 なので、エラー回避のために、パースが失敗したら全要素0の結果を返すようにしています。