[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH 01/11] gdbstub: move allocation of GDBState to one place
From: |
Richard Henderson |
Subject: |
Re: [RFC PATCH 01/11] gdbstub: move allocation of GDBState to one place |
Date: |
Mon, 18 Nov 2019 08:41:52 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 |
On 11/15/19 6:29 PM, Alex Bennée wrote:
>
> static GDBState *gdbserver_state;
>
> +static GDBState *gdb_allocate_state(void)
> +{
> + g_assert(!gdbserver_state);
> + gdbserver_state = g_new0(GDBState, 1);
> + return gdbserver_state;
> +}
> +
Actually, if we're only going to have one, why are we allocating it
dynamically? We might as well allocate it statically and drop the pointer
indirection.
r~
- [RFC PATCH 00/11] gdbstub re-factor and SVE support, Alex Bennée, 2019/11/15
- [RFC PATCH 06/11] target/arm: use gdb_get_reg helpers, Alex Bennée, 2019/11/15
- [RFC PATCH 05/11] gdbstub: add helper for 128 bit registers, Alex Bennée, 2019/11/15
- [RFC PATCH 04/11] gdbstub: move mem_buf to GDBState and use GByteArray, Alex Bennée, 2019/11/15
- [RFC PATCH 07/11] target/m68k: use gdb_get_reg helpers, Alex Bennée, 2019/11/15