|
c79c8033
|
2019-11-09T21:25:01
|
|
atom: combine atom_intern() and atom_lookup()
Use an "add" bool parameter instead. This simplifies the code a bit.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
2af474e8
|
2019-11-02T13:31:44
|
|
parser: get rid of "stealing" atoms
This requires (well, at least implemented by) casting away `const` which
is undefined behavior, and clang started to warn about it.
The micro optimization didn't save too many allocations, anyway.
Signed-off-by: Ran Benita <ran@unusedvar.com>
|
|
58345f4e
|
2013-12-02T14:14:41
|
|
atom: drop {xkb_,}atom_strdup
Even though in 112cccb18ad1bc877b3c4a87fa536ea085c761b5 I said it might
be useful, it's not. So remove it.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
7e0ae4b4
|
2013-07-21T16:41:27
|
|
atom: allow interning non-NUL-terminated strings
We need this later. The strlen was calculated anyway, so no loss here.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
9cd29453
|
2013-07-21T16:32:21
|
|
atom: expand variable names
A bit easier to understand at a glance.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
b2110705
|
2012-09-16T14:45:32
|
|
Organize src/ and test/ headers
- Add context.h and move context-related functions from xkb-priv.h to
it.
- Move xkb_context definition back to context.c.
- Add keysym.h and move keysym upper/lower/keypad from xkb-priv.h to it.
- Rename xkb-priv.h to map.h since it only contains keymap-related
definitions and declarations now.
- Remove unnecessary includes and some and some other small cleanups.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
b4b40d73
|
2012-09-12T16:54:07
|
|
Copyright updates
With Dan Nicholson's permission (via email), update his copyright and
license statements to the standard X.Org boilerplate MIT license, as
both myself and Ran have been using.
Clean up my copyright declarations (in some cases to correct ownership),
and add copyright/license statements from myself and/or Ran where
appropriate.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
7aa31097
|
2012-08-31T18:52:26
|
|
atom: add xkb_atom_lookup
This will only lookup the string and return the atom if found; it will
not intern it if not. This is useful when e.g. getting a string from the
user (which may be arbitrary) and comparing against atoms.
Signed-off-by: Ran Benita <ran234@gmail.com>
|
|
112cccb1
|
2012-07-23T16:03:34
|
|
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>
|
|
9308a460
|
2012-07-17T10:20:15
|
|
Run source tree through uncrustify
.uncrustify.cfg committed for future reference also, but had to manually
fix up a few things: it really likes justifying struct initialisers.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
|
|
699a0b84
|
2012-05-09T14:02:26
|
|
Contextualize the atom table
Each context gets its own table, i.e. interning a string in one context
does not affect any other context.
The existing xkb_atom_* functions are turned into wrappers around a new
standalone atom_table object.
Signed-off-by: Ran Benita <ran234@gmail.com>
[daniels: Updated for xkb -> keymap.]
|
|
cdd2906d
|
2012-05-09T13:50:05
|
|
Make the context available for XkbcAtomText
And rename the function to xkb_atom_text.
Signed-off-by: Ran Benita <ran234@gmail.com>
[daniels: Updated for xkb -> keymap.]
|
|
8d680e80
|
2012-05-09T12:01:03
|
|
Make the context available for XkbcAtomGetString
In preparation of contextualizing atom handling.
Since we touch every function call, we also rename the function to
xkb_atom_strdup to match xkb_atom_intern, and be more descriptive.
Signed-off-by: Ran Benita <ran234@gmail.com>
[daniels: Updated for xkb -> keymap.]
|
|
c117318f
|
2012-05-09T11:47:20
|
|
Make the context available to xkb_intern_atom
In preparation of contextualizing the atom table.
Since we touch every function call, also rename the function to
xkb_atom_intern, to match better with the rest (which will also be
renamed).
Signed-off-by: Ran Benita <ran234@gmail.com>
[daniels: Fixed for 'xkb' -> 'keymap'.]
|
|
b610b2b9
|
2012-05-08T14:52:23
|
|
Rename XKBcommonint.h to xkb-priv.h and use it
Make the files in the src/* directory use their own header or a
consilidated private header. This makes the file dependencies clearer.
Also drop the pointless "xkb" file name prefix, add split a few
declarations to their own files (atom.h and text.h).
Signed-off-by: Ran Benita <ran234@gmail.com>
|