Re: [PATCH 2/9] trace2: convert tr2tls_thread_ctx.thread_name from strbuf to char*
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 21, 2021, 07:33 UTC
- Message-ID
- <xmqqfsqmqunp.fsf@gitster.g>
- In-Reply-To
- <211220.86pmprutbz.gmgdl@evledraar.gmail.com>
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 8 quoted lines
>> struct tr2tls_thread_ctx {
>> - struct strbuf thread_name;
>> + char *thread_name;
>> uint64_t *array_us_start;
>> size_t alloc;
>> size_t nr_open_regions; /* plays role of "nr" in ALLOC_GROW */
>
> Junio's suggestion in the linked E-Mail was to make this a "const char *".Sorry, but in that linked E-Mail, I wasn't picking between "const char *" and "char *" at all. What I cared was *not* to keep a long-term constant string in a member whose type is "struct strbuf".