diff options
| author | Mattias EngdegÄrd | 2020-04-07 10:10:04 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2020-04-11 17:04:57 +0200 |
| commit | a79019c16b23f40c29509b6c0bf6f79d87f18c1e (patch) | |
| tree | 54586d19a1dc42b291095e87cb750dbadedcc615 /src/coding.h | |
| parent | 1988ffbaed709dfc71126efbf06644476830f07e (diff) | |
| download | emacs-a79019c16b23f40c29509b6c0bf6f79d87f18c1e.tar.gz emacs-a79019c16b23f40c29509b6c0bf6f79d87f18c1e.zip | |
Allow ENCODE_FILE and DECODE_FILE to use no-copy conversion
They already did return their argument under some circumstances;
this change broadens it to further reduce allocation in common cases
(bug#40407).
* src/coding.c (convert_string_nocopy): New function.
(decode_file_name, encode_file_name): Use convert_string_nocopy.
* src/coding.h (ENCODE_FILE, DECODE_FILE): Note the nocopy semantics.
Diffstat (limited to 'src/coding.h')
| -rw-r--r-- | src/coding.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/coding.h b/src/coding.h index 91856c5702b..c2a7b2a00ff 100644 --- a/src/coding.h +++ b/src/coding.h | |||
| @@ -642,11 +642,11 @@ struct coding_system | |||
| 642 | } while (false) | 642 | } while (false) |
| 643 | 643 | ||
| 644 | /* Encode the file name NAME using the specified coding system | 644 | /* Encode the file name NAME using the specified coding system |
| 645 | for file names, if any. */ | 645 | for file names, if any. May return NAME itself. */ |
| 646 | #define ENCODE_FILE(NAME) encode_file_name (NAME) | 646 | #define ENCODE_FILE(NAME) encode_file_name (NAME) |
| 647 | 647 | ||
| 648 | /* Decode the file name NAME using the specified coding system | 648 | /* Decode the file name NAME using the specified coding system |
| 649 | for file names, if any. */ | 649 | for file names, if any. May return NAME itself. */ |
| 650 | #define DECODE_FILE(NAME) decode_file_name (NAME) | 650 | #define DECODE_FILE(NAME) decode_file_name (NAME) |
| 651 | 651 | ||
| 652 | /* Encode the string STR using the specified coding system | 652 | /* Encode the string STR using the specified coding system |