]> git.alsa-project.org Git - alsa-lib.git/commit
ctl: use automatic variable instead of call of alloca(3)
authorTakashi Sakamoto <o-takashi@sakamocchi.jp>
Mon, 27 Jun 2016 14:37:36 +0000 (23:37 +0900)
committerTakashi Iwai <tiwai@suse.de>
Mon, 27 Jun 2016 15:56:21 +0000 (17:56 +0200)
commit06a51e29f46acd2d1b03befa2a5765cedca9051b
tree2b3c302d974f98fd9f645f574dca54264d5c2d99
parent7bc886584f30e94c817cdfa0857168e50b189f45
ctl: use automatic variable instead of call of alloca(3)

Inner this library, layouts of all structures are public. At a compilation
time, each size of the structures can be calculated. It means that we can
use automatic variable instead of calling alloca(3) to program this
library because in both ways storages are kept on stack frame of process
VMA. Besides, the usage of automatic variables requires less instructions
than calls of alloca(3). Furthermore, alloca(3) is not described in any
C language standards.

This commit replaces calls of alloca(3) just for structures with automatic
variables, for control features.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/control/control.c
src/control/ctlparse.c
src/control/namehint.c
src/control/setup.c
src/control/tlv.c