You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Module code can store values for later use, e.g. in background threads.
Frequently-used symbols won't require repeated intern calls into the Lisp runtime. We can have emacs::sym::nil, emacs::sym::t. Modules will also be able to declare symbols they often use.
Error handling will not need unsafe (even though the safety requirement is almost trivial currently).
The biggest problem with this is that free_global_ref() requires an emacs_env, thus cannot be used directly in GlobalValue::drop() (this is likely a mis-design in emacs-module (BEAM's enif_release_resource doesn't need an env, for example)). There are 2 potential ways to solve this:
Add fn free(self, env: &Env), and just leak on normal drops. They are supposed to be long-lived anyway.
Add a "mini-GC" by globally tracking to-be-free values, and freeing them in Env::drop(), once in a while.
The text was updated successfully, but these errors were encountered:
intern
calls into the Lisp runtime. We can haveemacs::sym::nil
,emacs::sym::t
. Modules will also be able to declare symbols they often use.unsafe
(even though the safety requirement is almost trivial currently).The biggest problem with this is that
free_global_ref()
requires anemacs_env
, thus cannot be used directly inGlobalValue::drop()
(this is likely a mis-design inemacs-module
(BEAM's enif_release_resource doesn't need an env, for example)). There are 2 potential ways to solve this:fn free(self, env: &Env)
, and just leak on normal drops. They are supposed to be long-lived anyway.Env::drop()
, once in a while.The text was updated successfully, but these errors were encountered: