[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: malloca, freea are not thread-safe
From: |
Bruno Haible |
Subject: |
Re: malloca, freea are not thread-safe |
Date: |
Sat, 03 Feb 2018 01:57:45 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-104-generic; KDE/5.18.0; x86_64; ; ) |
Hi Paul,
> By the way, why write "if __GNUC__ >= 5 && !defined __cplusplus &&
> !defined __clang__" instead of "ifdef __CHKP__"? The latter is easier to
> read....
I couldn't find any documentation for this __CHKP__ macro.
> An advantage of the #ifdef __CHKP__ code I suggested is
> that it never calculates a pointer outside the bounds of the
> newly-allocated block (or to just past the block). Such calculations
> violate the C standard
The code that I committed does not have such "bad" pointers in intermediate
expressions either. It computes a valid pointer, converts it to uintptr_t,
does some arithmetic on it, and then converts back to a pointer. Since the
resulting pointer is in the malloc'ed range, it is valid.
Bruno
- Re: malloca, freea are not thread-safe, Florian Weimer, 2018/02/01
- Re: malloca, freea are not thread-safe, Bruno Haible, 2018/02/02
- Re: malloca, freea are not thread-safe, Paul Eggert, 2018/02/02
- Re: malloca, freea are not thread-safe, Bruno Haible, 2018/02/02
- Re: malloca, freea are not thread-safe, Bruno Haible, 2018/02/02
- Re: malloca, freea are not thread-safe, Paul Eggert, 2018/02/02
- Re: malloca, freea are not thread-safe,
Bruno Haible <=
- Re: malloca, freea are not thread-safe, Paul Eggert, 2018/02/04
- Re: malloca, freea, and Intel MPX, Bruno Haible, 2018/02/03
- Re: malloca, freea, and Intel MPX, Paul Eggert, 2018/02/04
- Re: malloca, freea, and Intel MPX, Bruno Haible, 2018/02/04
- Re: malloca, freea, and Intel MPX, Paul Eggert, 2018/02/04
- Re: malloca, freea are not thread-safe, Florian Weimer, 2018/02/03
- Re: malloca, freea are not thread-safe, Bruno Haible, 2018/02/03
- Re: Intel mpx, Bruno Haible, 2018/02/03
- Re: malloca, freea are not thread-safe, Paul Eggert, 2018/02/04