Commit Graph

5 Commits

Author SHA1 Message Date
Pierre Habouzit b4b381e947 Finish markup parsing rewrite to avoid mallocs.
For that matter, use elements as a filter for elements we care about, and
let the hook implement whatever it needs without duplicating everything.

The resulting algorithm is still O(n²) where n is the number of filtered
elements (3 at most right now), which isn't bad if we don't need to get
too many elements, but at least it's not quadratic in the number of
attributes anymore.

Speedup improvements could be done using gperf btw.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 17:45:45 +02:00
Pierre Habouzit 943e2035fa Rework the markup_parser_* allocation API.
We have a stack, don't be ashamed to use it.

Instead of:

    foo_t *foo;

    foo = foo_new();
    /* work with foo */
    foo_delete(&foo);

It's way better to:

    foo_t foo;

    foo_init(&foo);
    /* work with &foo */
    foo_wipe(&foo);

Remember: more mallocs == more fragmentation.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 16:17:12 +02:00
Pierre Habouzit e25a50774b Add extensible buffers to awesome.
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
2008-06-22 15:04:09 +02:00
Julien Danjou 7a8e39b3e7 [markup] Add generic substitution of elements and use it for titlebar
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-03 12:01:04 +02:00
Julien Danjou a4159bbaf7 [draw] Implement a more generic markup parser
Signed-off-by: Julien Danjou <julien@danjou.info>
2008-05-03 12:01:04 +02:00