[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Fix #1414 by not mallocing in a signal han
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] [PATCH] Fix #1414 by not mallocing in a signal handler |
Date: |
Sun, 17 Sep 2017 12:31:18 +0200 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Sun, Sep 17, 2017 at 05:43:07PM +1200, Evan Hanson wrote:
> Hi Peter,
>
> I've applied this to both branches. Thanks for the explanation, it was
> helpful in trying to figure out what will happen when the trace buffer
> is filled more quickly than signals arrive. I also had to convince
> myself that the behaviour is correct when signals outpace new trace
> entries, and it seems to me that in this case the active trace entry
> will remain the same across multiple invocations of
> take_profile_sample() and no allocation is actually necessary due to the
> early exit.
Yeah, this is a bit subtle, and maybe overly clever. But it helps a lot
to keep this code relatively short and simple.
> Attached is a tiny, unrelated change for something I noticed while
> reviewing: I think we don't need to check for NULL trace buffer keys in
> take_profile_sample() since the top pointer of that buffer is only ever
> bumped *after* the whole entry has been populated, so that procedure
> will never see a NULL value in the "raw" field.
Well spotted, I've applied it.
Cheers,
Peter
signature.asc
Description: PGP signature