diff options
| author | Dmitry Antipov | 2013-12-16 11:45:33 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2013-12-16 11:45:33 +0400 |
| commit | 5ae356d99130af32b51a0cd67d1933ed9e6cd20e (patch) | |
| tree | 4d68dfd538ce4a7ef56027218f5ec1582d5b73df /src/alloc.c | |
| parent | 2013a2f955e4dc6edf9869767e9f5d70fbf9d69c (diff) | |
| download | emacs-5ae356d99130af32b51a0cd67d1933ed9e6cd20e.tar.gz emacs-5ae356d99130af32b51a0cd67d1933ed9e6cd20e.zip | |
* font.c (valid_font_driver) [ENABLE_CHECKING]: New function
intended to find bogus pointers in font objects (Bug#16140).
* font.h (valid_font_driver) [ENABLE_CHECKING]: Add prototype.
* alloc.c (cleanup_vector): Use valid_font_driver in eassert.
(compact_font_cache_entry, compact_font_caches) [!HAVE_NTGUI]:
Disable for MS-Windows due to Bug#15876; apparently this
requires more or less substantial changes in fontset code.
* xfont.c (xfont_close):
* xftfont.c (xftfont_close): Call x_display_info_for_display
to check whether 'Display *' is valid (Bug#16093 and probably
Bug#16069).
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/alloc.c b/src/alloc.c index aeda42637cd..447b465a076 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -2877,7 +2877,11 @@ cleanup_vector (struct Lisp_Vector *vector) | |||
| 2877 | if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT) | 2877 | if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_FONT) |
| 2878 | && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) | 2878 | && ((vector->header.size & PSEUDOVECTOR_SIZE_MASK) |
| 2879 | == FONT_OBJECT_MAX)) | 2879 | == FONT_OBJECT_MAX)) |
| 2880 | ((struct font *) vector)->driver->close ((struct font *) vector); | 2880 | { |
| 2881 | /* Attempt to catch subtle bugs like Bug#16140. */ | ||
| 2882 | eassert (valid_font_driver (((struct font *) vector)->driver)); | ||
| 2883 | ((struct font *) vector)->driver->close ((struct font *) vector); | ||
| 2884 | } | ||
| 2881 | } | 2885 | } |
| 2882 | 2886 | ||
| 2883 | /* Reclaim space used by unmarked vectors. */ | 2887 | /* Reclaim space used by unmarked vectors. */ |
| @@ -5299,6 +5303,10 @@ total_bytes_of_live_objects (void) | |||
| 5299 | 5303 | ||
| 5300 | #ifdef HAVE_WINDOW_SYSTEM | 5304 | #ifdef HAVE_WINDOW_SYSTEM |
| 5301 | 5305 | ||
| 5306 | /* This code has a few issues on MS-Windows, see Bug#15876 and Bug#16140. */ | ||
| 5307 | |||
| 5308 | #if !defined (HAVE_NTGUI) | ||
| 5309 | |||
| 5302 | /* Remove unmarked font-spec and font-entity objects from ENTRY, which is | 5310 | /* Remove unmarked font-spec and font-entity objects from ENTRY, which is |
| 5303 | (DRIVER-TYPE NUM-FRAMES FONT-CACHE-DATA ...), and return changed entry. */ | 5311 | (DRIVER-TYPE NUM-FRAMES FONT-CACHE-DATA ...), and return changed entry. */ |
| 5304 | 5312 | ||
| @@ -5337,6 +5345,8 @@ compact_font_cache_entry (Lisp_Object entry) | |||
| 5337 | return entry; | 5345 | return entry; |
| 5338 | } | 5346 | } |
| 5339 | 5347 | ||
| 5348 | #endif /* not HAVE_NTGUI */ | ||
| 5349 | |||
| 5340 | /* Compact font caches on all terminals and mark | 5350 | /* Compact font caches on all terminals and mark |
| 5341 | everything which is still here after compaction. */ | 5351 | everything which is still here after compaction. */ |
| 5342 | 5352 | ||
| @@ -5348,7 +5358,7 @@ compact_font_caches (void) | |||
| 5348 | for (t = terminal_list; t; t = t->next_terminal) | 5358 | for (t = terminal_list; t; t = t->next_terminal) |
| 5349 | { | 5359 | { |
| 5350 | Lisp_Object cache = TERMINAL_FONT_CACHE (t); | 5360 | Lisp_Object cache = TERMINAL_FONT_CACHE (t); |
| 5351 | 5361 | #if !defined (HAVE_NTGUI) | |
| 5352 | if (CONSP (cache)) | 5362 | if (CONSP (cache)) |
| 5353 | { | 5363 | { |
| 5354 | Lisp_Object entry; | 5364 | Lisp_Object entry; |
| @@ -5356,6 +5366,7 @@ compact_font_caches (void) | |||
| 5356 | for (entry = XCDR (cache); CONSP (entry); entry = XCDR (entry)) | 5366 | for (entry = XCDR (cache); CONSP (entry); entry = XCDR (entry)) |
| 5357 | XSETCAR (entry, compact_font_cache_entry (XCAR (entry))); | 5367 | XSETCAR (entry, compact_font_cache_entry (XCAR (entry))); |
| 5358 | } | 5368 | } |
| 5369 | #endif /* not HAVE_NTGUI */ | ||
| 5359 | mark_object (cache); | 5370 | mark_object (cache); |
| 5360 | } | 5371 | } |
| 5361 | } | 5372 | } |