]> code.delx.au - pulseaudio/commit
dynarray: Reimplement with nicer semantics
authorTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Wed, 26 Jun 2013 13:13:47 +0000 (16:13 +0300)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Thu, 27 Jun 2013 08:45:41 +0000 (11:45 +0300)
commit0f2840f4c6fa69047991e1df10a4e82623ad45ca
tree3199573bc77bb5179fb085e8d5dba32c8b66f558
parentd00d5b6611e21ab38af2066c098b1604298a261f
dynarray: Reimplement with nicer semantics

A dynamic array is a nice simple container, but the old interface
wasn't quite what I wanted it to be. I like GLib's way of providing
the free callback at the container creation time, because that way
the free callback doesn't have to be given every time something is
removed from the array.

The allocation pattern was changed too: instead of increasing the
array size always by 25 when the array gets full, the size gets
doubled now (the lowest non-zero size is still 25).

The array can't store NULL pointers anymore, and pa_dynarray_get() was
changed so that it's forbidden to try to access elements outside the
valid range.

The set of supported operations may seem a bit arbitrary. The
operation set is by no means complete at this point. I have included
only those operations that are required by the current code and some
unpublished code of mine.
src/pulsecore/cli-command.c
src/pulsecore/dynarray.c
src/pulsecore/dynarray.h
src/pulsecore/tokenizer.c