Skip to content

misc: Replace alloca() by g_malloc()

Philippe Mathieu-Daudé kvm qemu-arm qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest17 patches 7 repliesIn review
  2. v29 patches 24 repliesSuperseded
  3. v15 patches 7 repliesSuperseded

Changes in v3 from the cover letter

- linux-user calls converted
- bsd-user returns ENOMEM (Peter)
- built on PPC+KVM host (David)
- removed tpm mutex cleanup (Christophe)
- included Alex gdbstub patch
- added R-b tags

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17bsd-user/syscall: Replace alloca() by g_try_new()bsd-user/syscall.c+5 -20 replies
2/17linux-user/elfload: Replace alloca() by g_try_malloc()linux-user/elfload.c+10 -40 replies
3/17linux-user/syscall: Replace alloca() by g_try_new()linux-user/syscall.c+17 -80 replies
4/17linux-user/syscall: Replace alloca() by g_try_malloc()linux-user/syscall.c+10 -50 replies
5/17linux-user: Replace alloca() by g_try_new() in ppoll() syscalllinux-user/syscall.c+5 -30 replies
6/17linux-user: Replace alloca() by g_try_malloc() in setsockopt() syscalllinux-user/syscall.c+14 -50 replies
7/17linux-user: Replace alloca() by g_try_malloc() in various socket syscalllinux-user/syscall.c+35 -150 replies
8/17linux-user/syscall: Move code around in do_sendrecvmsg_locked()linux-user/syscall.c+6 -70 replies
9/17linux-user/syscall: Replace alloca() by GLib alloc() in sendrecvmsglinux-user/syscall.c+8 -30 replies
10/17audio/alsaaudio: Replace ALSA alloca() by malloc() equivalentaudio/alsaaudio.c+7 -40 replies
11/17backends/tpm: Replace g_alloca() by g_malloc()backends/tpm/tpm_emulator.c+1 -20 replies
12/17gdbstub: Constify GdbCmdParseEntrygdbstub.c+4 -40 replies
13/17gdbstub: Replace GdbCmdContext with plain g_array()gdbstub.c+146 -1680 replies
14/17hw/misc/pca9552: Replace g_newa() by g_new()hw/misc/pca9552.c+1 -11 reply
15/17target/ppc/kvm: Replace alloca() by g_malloc()target/ppc/kvm.c+2 -21 reply
16/17configure: Prohibit alloca() by using -Walloca CPPFLAGconfigure+1 -11 reply
17/17configure: libSLiRP buildsys kludgeconfigure+9 -11 reply

Reviews trailers per patch

5 of 17 patches have a Reviewed-by or Acked-by.

PatchStefan BergerAlex BennéePhilippe Mathieu-DaudéGreg KurzDavid GibsonCédric Le Goater
1/17
2/17
3/17
4/17
5/17
6/17
7/17
8/17
9/17
10/17
11/17R-b
12/17R-b
13/17R-b
14/17R-b
15/17R-b A-b
16/17
17/17

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/17] misc: Replace alloca() by g_malloc()

The ALLOCA(3) man-page mentions its "use is discouraged". Replace few calls by equivalent GLib malloc().

Since v2:
- linux-user calls converted
- bsd-user returns ENOMEM (Peter)
- built on PPC+KVM host (David)
- removed tpm mutex cleanup (Christophe)
- included Alex gdbstub patch
- added R-b tags

Since v1:
- Converted more uses (alsaaudio, tpm, pca9552)
- Reworked gdbstub (Alex)
- Simplified PPC/KVM (Greg)

Alex Bennée (1):
gdbstub: Replace GdbCmdContext with plain g_array()

Philippe Mathieu-Daudé (16):
bsd-user/syscall: Replace alloca() by g_try_new() linux-user/elfload: Replace alloca() by g_try_malloc() linux-user/syscall: Replace alloca() by g_try_new() linux-user/syscall: Replace alloca() by g_try_malloc()
linux-user: Replace alloca() by g_try_new() in ppoll() syscall
linux-user: Replace alloca() by g_try_malloc() in setsockopt() syscall
linux-user: Replace alloca() by g_try_malloc() in various socket
syscall
linux-user/syscall: Move code around in do_sendrecvmsg_locked() linux-user/syscall: Replace alloca() by GLib alloc() in sendrecvmsg audio/alsaaudio: Replace ALSA alloca() by malloc() equivalent backends/tpm: Replace g_alloca() by g_malloc()
gdbstub: Constify GdbCmdParseEntry
hw/misc/pca9552: Replace g_newa() by g_new() target/ppc/kvm: Replace alloca() by g_malloc()
configure: Prohibit alloca() by using -Walloca CPPFLAG
configure: libSLiRP buildsys kludge

 configure                   |   8 +
 audio/alsaaudio.c           |  11 +-
 backends/tpm/tpm_emulator.c |   3 +-
 bsd-user/syscall.c          |   7 +-
 gdbstub.c                   | 322 +++++++++++++++++-------------------
 hw/misc/pca9552.c           |   2 +-
 linux-user/elfload.c        |  14 +-
 linux-user/syscall.c        | 137 ++++++++++-----
 target/ppc/kvm.c            |   4 +-
 9 files changed, 277 insertions(+), 231 deletions(-)
Signature · 1 line
2.26.3