summaryrefslogtreecommitdiff
path: root/src/coding.h
diff options
context:
space:
mode:
authorMattias EngdegÄrd <mattiase@acm.org>2020-04-07 10:10:04 +0200
committerMattias EngdegÄrd <mattiase@acm.org>2020-04-11 17:04:57 +0200
commita79019c16b23f40c29509b6c0bf6f79d87f18c1e (patch)
tree54586d19a1dc42b291095e87cb750dbadedcc615 /src/coding.h
parent1988ffbaed709dfc71126efbf06644476830f07e (diff)
downloademacs-a79019c16b23f40c29509b6c0bf6f79d87f18c1e.tar.gz
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.h4
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
} while (false)
/* Encode the file name NAME using the specified coding system
- for file names, if any. */
+ for file names, if any. May return NAME itself. */
#define ENCODE_FILE(NAME) encode_file_name (NAME)
/* Decode the file name NAME using the specified coding system
- for file names, if any. */
+ for file names, if any. May return NAME itself. */
#define DECODE_FILE(NAME) decode_file_name (NAME)
/* Encode the string STR using the specified coding system