diff options
| author | Jan Djärv | 2012-10-12 12:01:05 +0200 |
|---|---|---|
| committer | Jan Djärv | 2012-10-12 12:01:05 +0200 |
| commit | 2b9c2e68501ac897447340bd3f2af8e88f03d767 (patch) | |
| tree | f181604780b8e9bbba9a5d105359e8c08220d7bd /src | |
| parent | 81749a2374c78d656888b462f3b29301e4cbd1c7 (diff) | |
| download | emacs-2b9c2e68501ac897447340bd3f2af8e88f03d767.tar.gz emacs-2b9c2e68501ac897447340bd3f2af8e88f03d767.zip | |
* nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/nsfont.m | 34 |
2 files changed, 6 insertions, 32 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2a66f5df62c..47b2de24844 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-10-12 Jan Djärv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * nsfont.m (nsfont_open): Remove font cache, it is not GC correct. | ||
| 4 | |||
| 1 | 2012-10-12 Glenn Morris <rgm@gnu.org> | 5 | 2012-10-12 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * buffer.c (Fset_buffer): Doc fix. (Bug#12624) | 7 | * buffer.c (Fset_buffer): Doc fix. (Bug#12624) |
diff --git a/src/nsfont.m b/src/nsfont.m index a820b60ac58..7c9f05aa0bb 100644 --- a/src/nsfont.m +++ b/src/nsfont.m | |||
| @@ -729,16 +729,6 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) | |||
| 729 | NSRect brect; | 729 | NSRect brect; |
| 730 | Lisp_Object font_object; | 730 | Lisp_Object font_object; |
| 731 | int fixLeopardBug; | 731 | int fixLeopardBug; |
| 732 | static NSMutableDictionary *fontCache = nil; | ||
| 733 | NSNumber *cached; | ||
| 734 | |||
| 735 | /* 2008/03/08: The same font may end up being requested for different | ||
| 736 | entities, due to small differences in numeric values or other issues, | ||
| 737 | or for different copies of the same entity. Therefore we cache to | ||
| 738 | avoid creating multiple struct font objects (with metrics cache, etc.) | ||
| 739 | for the same NSFont object. */ | ||
| 740 | if (fontCache == nil) | ||
| 741 | fontCache = [[NSMutableDictionary alloc] init]; | ||
| 742 | 732 | ||
| 743 | if (NSFONT_TRACE) | 733 | if (NSFONT_TRACE) |
| 744 | { | 734 | { |
| @@ -794,28 +784,8 @@ nsfont_open (FRAME_PTR f, Lisp_Object font_entity, int pixel_size) | |||
| 794 | if (NSFONT_TRACE) | 784 | if (NSFONT_TRACE) |
| 795 | NSLog (@"%@\n", nsfont); | 785 | NSLog (@"%@\n", nsfont); |
| 796 | 786 | ||
| 797 | /* Check the cache */ | 787 | font_object = font_make_object (VECSIZE (struct nsfont_info), |
| 798 | cached = [fontCache objectForKey: nsfont]; | 788 | font_entity, pixel_size); |
| 799 | if (cached != nil && !synthItal) | ||
| 800 | { | ||
| 801 | if (NSFONT_TRACE) | ||
| 802 | fprintf(stderr, "*** nsfont_open CACHE HIT!\n"); | ||
| 803 | XHASH (font_object) = [cached unsignedLongLongValue]; | ||
| 804 | return font_object; | ||
| 805 | } | ||
| 806 | else | ||
| 807 | { | ||
| 808 | font_object = font_make_object (VECSIZE (struct nsfont_info), | ||
| 809 | font_entity, pixel_size); | ||
| 810 | if (!synthItal) | ||
| 811 | { | ||
| 812 | [fontCache setObject: [NSNumber | ||
| 813 | numberWithUnsignedLongLong: | ||
| 814 | (unsigned long long) XHASH (font_object)] | ||
| 815 | forKey: nsfont]; | ||
| 816 | } | ||
| 817 | } | ||
| 818 | |||
| 819 | font_info = (struct nsfont_info *) XFONT_OBJECT (font_object); | 789 | font_info = (struct nsfont_info *) XFONT_OBJECT (font_object); |
| 820 | font = (struct font *) font_info; | 790 | font = (struct font *) font_info; |
| 821 | if (!font) | 791 | if (!font) |