Atoms: Avoid allocations in XkbAtomText()
authorDaniel Stone <daniel@fooishbar.org>
Tue, 15 Jun 2010 18:30:30 +0000 (19:30 +0100)
committerDaniel Stone <daniel@fooishbar.org>
Tue, 22 Jun 2010 14:56:56 +0000 (15:56 +0100)
commit48baabeb38c0afc3dc071038662f43419b058cf4
tree016f891bafe6b5f1928b31855168c55d5f036bc7
parent080a083fd26a05176b40f810f36ebe22b77d477c
Atoms: Avoid allocations in XkbAtomText()

XkbAtomGetString() returns a freshly-allocated string, whereas
XkbAtomText() returns the same in a temporary buffer.  XkbAtomText used
to call XkbAtomGetString() and then free the result, which seems quite
spectacularly pointless when you think about it.  Shuffle the atom code
around so we don't have to allocate for XkbAtomText().

This changes semantics slightly wrt non-printable characters, but I
haven't been able to see any effect so far.  And it may well be ever so
slightly quicker.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
src/atom.c
src/text.c