1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00
elinks/src/cache
Kalle Olavi Niemitalo 314a41588c Bug 951: weaken pointer from JSObject to cache_entry
The SpiderMonkey scripting module handles the "pre-format-html" event
by constructing a JSObject for the struct cache_entry and then calling
elinks.preformat_html(cache_entry, view_state) if such a function
exists.  The problem with this was that each such JSObject kept the
struct cache_entry locked until SpiderMonkey garbage-collected the
JSObject, even if the user had not defined an elinks.preformat_html
function and the JSObject was thus never needed at all.  To work
around that, the SpiderMonkey scripting module ran a garbage
collection whenever the user told ELinks to flush caches.

Remove the SpiderMonkey scripting module's use of object_lock and
object_unlock on struct cache_entry, and instead make the pointers
weak so that ELinks can free the cache_entry whenever it wants even if
a JSObject is pointing to it.  Each cache_entry now has a pointer back
to the JSObject; done_cache_entry calls smjs_detach_cache_entry_object,
which follows the pointer and detaches the cache_entry and the JSObject
from each other.

This commit does not yet remove the workaround mentioned above.
2008-07-07 23:24:43 +03:00
..
cache.c Bug 951: weaken pointer from JSObject to cache_entry 2008-07-07 23:24:43 +03:00
cache.h Bug 951: weaken pointer from JSObject to cache_entry 2008-07-07 23:24:43 +03:00
dialogs.c Debian bug 464384: fix OFF_T_FORMAT mismatches on amd64 2008-02-10 11:30:27 +02:00
dialogs.h Remove empty lines in start of header files 2005-11-15 11:33:27 +01:00
Makefile path_to_top -> top_builddir 2005-10-20 04:00:35 +02:00