aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/atom.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-01-28 14:32:54 +0100
committerSverker Eriksson <[email protected]>2013-01-28 14:32:54 +0100
commit58482ed3f2b2f90f8be35b85d5d16f3f40f80fa3 (patch)
treea22f36b6de5d54769d2392b79edf1366964a8a5c /erts/emulator/beam/atom.c
parentd4fd0da2e1fc541bae7ed2de362f8a5f69357e27 (diff)
parent6c61689ae326587dfc9bcebd0fc6d6fa40dfd1fb (diff)
downloadotp-58482ed3f2b2f90f8be35b85d5d16f3f40f80fa3.tar.gz
otp-58482ed3f2b2f90f8be35b85d5d16f3f40f80fa3.tar.bz2
otp-58482ed3f2b2f90f8be35b85d5d16f3f40f80fa3.zip
Merge branch 'sverk/enc_atom-opt'
* sverk/enc_atom-opt: erts: Optimize atom encoding to use memcpy for pure ascii erts: Refactor erts_atom_get to use ErtsAtomEncoding
Diffstat (limited to 'erts/emulator/beam/atom.c')
-rw-r--r--erts/emulator/beam/atom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/erts/emulator/beam/atom.c b/erts/emulator/beam/atom.c
index 259b5e49c1..b69f979397 100644
--- a/erts/emulator/beam/atom.c
+++ b/erts/emulator/beam/atom.c
@@ -367,7 +367,7 @@ int atom_table_sz(void)
}
int
-erts_atom_get(const char *name, int len, Eterm* ap, int is_latin1)
+erts_atom_get(const char *name, int len, Eterm* ap, ErtsAtomEncoding enc)
{
byte utf8_copy[MAX_ATOM_SZ_FROM_LATIN1];
Atom a;
@@ -376,7 +376,7 @@ erts_atom_get(const char *name, int len, Eterm* ap, int is_latin1)
a.len = (Sint16) len;
a.name = (byte *)name;
- if (is_latin1) {
+ if (enc == ERTS_ATOM_ENC_LATIN1) {
latin1_to_utf8(utf8_copy, (const byte**)&a.name, &len);
a.len = (Sint16) len;
}