diff options
| author | Paul Eggert | 2016-04-04 10:30:41 -0700 |
|---|---|---|
| committer | Paul Eggert | 2016-04-04 10:31:25 -0700 |
| commit | 17cb263adb7c37803140604f0a2e4df8a38fbcff (patch) | |
| tree | bd57929386123132847718e2d30a528c8b19d1a3 /src/ftfont.c | |
| parent | 0322457e2bec0b9409a03887a8235dbe14e357f4 (diff) | |
| download | emacs-17cb263adb7c37803140604f0a2e4df8a38fbcff.tar.gz emacs-17cb263adb7c37803140604f0a2e4df8a38fbcff.zip | |
New C macro AUTO_STRING_WITH_LEN
Put a bit less pressure on the garbage collector by defining a
macro that is like AUTO_STRING but also allows null bytes in strings,
and by extending AUTO_STRING to work with any unibyte string.
* src/alloc.c (verify_ascii): Remove; all uses removed.
AUTO_STRING can now be used on non-ASCII unibyte strings.
* src/lisp.h (AUTO_STRING): Now allows non-ASCII unibyte strings.
(AUTO_STRING_WITH_LEN): New macro.
* src/coding.c (from_unicode_buffer):
* src/editfns.c (format_time_string):
* src/emacs-module.c (module_make_string, module_format_fun_env):
* src/fileio.c (Fexpand_file_name):
* src/font.c (font_parse_family_registry):
* src/ftfont.c (ftfont_get_charset):
* src/keymap.c (silly_event_symbol_error):
* src/menu.c (single_menu_item):
* src/sysdep.c (system_process_attributes):
Use AUTO_STRING_WITH_LEN if possible.
* src/emacs-module.c (module_make_function):
* src/fileio.c (report_file_errno, report_file_notify_error):
* src/fns.c (Flocale_info):
* src/sysdep.c (system_process_attributes):
Use AUTO_STRING if possible. This is doable more often now
that AUTO_STRING works on any unibyte string.
Diffstat (limited to 'src/ftfont.c')
| -rw-r--r-- | src/ftfont.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/ftfont.c b/src/ftfont.c index 7285aee9bd4..1ae3f88daa3 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -568,7 +568,6 @@ ftfont_get_charset (Lisp_Object registry) | |||
| 568 | char *str = SSDATA (SYMBOL_NAME (registry)); | 568 | char *str = SSDATA (SYMBOL_NAME (registry)); |
| 569 | USE_SAFE_ALLOCA; | 569 | USE_SAFE_ALLOCA; |
| 570 | char *re = SAFE_ALLOCA (SBYTES (SYMBOL_NAME (registry)) * 2 + 1); | 570 | char *re = SAFE_ALLOCA (SBYTES (SYMBOL_NAME (registry)) * 2 + 1); |
| 571 | Lisp_Object regexp; | ||
| 572 | int i, j; | 571 | int i, j; |
| 573 | 572 | ||
| 574 | for (i = j = 0; i < SBYTES (SYMBOL_NAME (registry)); i++, j++) | 573 | for (i = j = 0; i < SBYTES (SYMBOL_NAME (registry)); i++, j++) |
| @@ -582,13 +581,13 @@ ftfont_get_charset (Lisp_Object registry) | |||
| 582 | re[j] = '.'; | 581 | re[j] = '.'; |
| 583 | } | 582 | } |
| 584 | re[j] = '\0'; | 583 | re[j] = '\0'; |
| 585 | regexp = make_unibyte_string (re, j); | 584 | AUTO_STRING_WITH_LEN (regexp, re, j); |
| 586 | SAFE_FREE (); | ||
| 587 | for (i = 0; fc_charset_table[i].name; i++) | 585 | for (i = 0; fc_charset_table[i].name; i++) |
| 588 | if (fast_c_string_match_ignore_case | 586 | if (fast_c_string_match_ignore_case |
| 589 | (regexp, fc_charset_table[i].name, | 587 | (regexp, fc_charset_table[i].name, |
| 590 | strlen (fc_charset_table[i].name)) >= 0) | 588 | strlen (fc_charset_table[i].name)) >= 0) |
| 591 | break; | 589 | break; |
| 590 | SAFE_FREE (); | ||
| 592 | if (! fc_charset_table[i].name) | 591 | if (! fc_charset_table[i].name) |
| 593 | return -1; | 592 | return -1; |
| 594 | if (! fc_charset_table[i].fc_charset) | 593 | if (! fc_charset_table[i].fc_charset) |