[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 07/11] disas: Cleanup plugin_disas
From: |
Alex Bennée |
Subject: |
Re: [PATCH v4 07/11] disas: Cleanup plugin_disas |
Date: |
Tue, 22 Sep 2020 11:38:46 +0100 |
User-agent: |
mu4e 1.5.5; emacs 28.0.50 |
Richard Henderson <richard.henderson@linaro.org> writes:
> Do not retain a GString in thread-local storage. Allocate a
> new one and free it on every invocation. Do not g_strdup the
> result; return the buffer from the GString. Do not use
> warn_report.
>
> Using cs_disasm allocated memory via the &insn parameter, but
> that was never freed. Use cs_disasm_iter so that we use the
> memory that we've already allocated, and so that we only try
> to disassemble one insn, as desired. Do not allocate 1k to
> hold the bytes for a single instruction.
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
- [PATCH v4 03/11] capstone: Require version 4.0 from a system library, (continued)
- [PATCH v4 03/11] capstone: Require version 4.0 from a system library, Richard Henderson, 2020/09/21
- [PATCH v4 01/11] capstone: Convert Makefile bits to meson bits, Richard Henderson, 2020/09/21
- [PATCH v4 05/11] disas: Clean up CPUDebug initialization, Richard Henderson, 2020/09/21
- [PATCH v4 08/11] disas: Configure capstone for aarch64 host without libvixl, Richard Henderson, 2020/09/21
- [PATCH v4 07/11] disas: Cleanup plugin_disas, Richard Henderson, 2020/09/21
- Re: [PATCH v4 07/11] disas: Cleanup plugin_disas,
Alex Bennée <=
- [PATCH v4 06/11] disas: Use qemu/bswap.h for bfd endian loads, Richard Henderson, 2020/09/21
- [PATCH v4 04/11] disas: Move host asm annotations to tb_gen_code, Richard Henderson, 2020/09/21
[PATCH v4 09/11] disas: Split out capstone code to disas/capstone.c, Richard Henderson, 2020/09/21
[PATCH v4 10/11] disas: Enable capstone disassembly for s390x, Richard Henderson, 2020/09/21