libxkbcommon/src
Ran Benita 112cccb18a Some atom related optimizations
We often get a strdup'd string, just to pass it over the atom_intern and
then immediately free it. But atom_intern then strdup's it again (if
it's not interned already); so instead we can have the interning "steal"
the memory instead of allocing a new one and freeing the old one. This
is done by a new xkb_atom_steal function.

It also turns out, that every time we strdup an atom, we don't actually
modify it afterwards. Since we are guaranteed that the atom table will
live as long as the context, we can just use xkb_atom_text instead. This
removes a some more dynamic allocations.

For this change we had to remove the ability to append two strings, e.g.
    "foo" + "bar" -> "foobar"
which is only possible with string literals. This is unused and quite
useless for our purposes.

xkb_atom_strdup is left unused, as it may still be useful.

Running rulescomp in valgrind, Before:
==7907== total heap usage: 173,698 allocs, 173,698 frees, 9,775,973 bytes allocated
After:
==6348== total heap usage: 168,403 allocs, 168,403 frees, 9,732,648 bytes allocated

Signed-off-by: Ran Benita <ran234@gmail.com>
2012-07-27 00:01:41 +03:00
..
xkbcomp Some atom related optimizations 2012-07-27 00:01:41 +03:00
.gitignore config: makekeys prog should stand alone in the makekeys directory 2010-12-18 11:19:56 -05:00
alloc.c Some atom related optimizations 2012-07-27 00:01:41 +03:00
alloc.h Pass around xkb_key's instead of keycodes 2012-07-18 12:47:29 +03:00
atom.c Some atom related optimizations 2012-07-27 00:01:41 +03:00
atom.h Some atom related optimizations 2012-07-27 00:01:41 +03:00
context.c Some atom related optimizations 2012-07-27 00:01:41 +03:00
darray.h Pass around xkb_key's instead of keycodes 2012-07-18 12:47:29 +03:00
keymap-dump.c utils: remove Xfuncproto.h and use our own macros 2012-07-23 00:45:34 +03:00
keysym-utf.c utils: remove Xfuncproto.h and use our own macros 2012-07-23 00:45:34 +03:00
keysym.c utils: remove Xfuncproto.h and use our own macros 2012-07-23 00:45:34 +03:00
list.h Fix bison 2.6 and clang warnings 2012-07-20 12:48:13 +03:00
map.c utils: remove Xfuncproto.h and use our own macros 2012-07-23 00:45:34 +03:00
state.c utils: remove Xfuncproto.h and use our own macros 2012-07-23 00:45:34 +03:00
text.c Get rid of xkb_key_names 2012-07-18 12:25:28 +03:00
text.h Run source tree through uncrustify 2012-07-17 10:20:15 +01:00
utils.h Remove old logging leftovers 2012-07-23 00:45:35 +03:00
xkb-priv.h Some atom related optimizations 2012-07-27 00:01:41 +03:00