Re: [Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-11 Thread Jose Fonseca
On 11/09/15 00:35, Erik Faye-Lund wrote: On Mon, Sep 7, 2015 at 3:54 PM, Jose Fonseca wrote: On 07/09/15 10:17, Jean-Sébastien Pédron wrote: On 04.09.2015 01:37, Matt Turner wrote: You need to test for this support in configure.ac. It's as simple as adding a call to

Re: [Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-10 Thread Jose Fonseca
On 10/09/15 02:54, Ian Romanick wrote: On 09/07/2015 06:54 AM, Jose Fonseca wrote: On 07/09/15 10:17, Jean-Sébastien Pédron wrote: On 04.09.2015 01:37, Matt Turner wrote: You need to test for this support in configure.ac. It's as simple as adding a call to AX_GCC_FUNC_ATTRIBUTE in the

Re: [Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-10 Thread Ian Romanick
On 09/10/2015 05:29 AM, Jose Fonseca wrote: > On 10/09/15 02:54, Ian Romanick wrote: >> On 09/07/2015 06:54 AM, Jose Fonseca wrote: >>> On 07/09/15 10:17, Jean-Sébastien Pédron wrote: On 04.09.2015 01:37, Matt Turner wrote: > You need to test for this support in configure.ac. It's as

Re: [Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-10 Thread Erik Faye-Lund
On Thu, Sep 10, 2015 at 7:58 PM, Ian Romanick wrote: > On 09/10/2015 05:29 AM, Jose Fonseca wrote: >> On 10/09/15 02:54, Ian Romanick wrote: >> >> It's not necessary to do it in several places, at least for the >> destructor -- we could have a single C++ module inside

Re: [Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-10 Thread Erik Faye-Lund
On Mon, Sep 7, 2015 at 3:54 PM, Jose Fonseca wrote: > On 07/09/15 10:17, Jean-Sébastien Pédron wrote: >> >> On 04.09.2015 01:37, Matt Turner wrote: >>> >>> You need to test for this support in configure.ac. It's as simple as >>> adding a call to AX_GCC_FUNC_ATTRIBUTE in the

Re: [Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-09 Thread Ian Romanick
On 09/07/2015 06:54 AM, Jose Fonseca wrote: > On 07/09/15 10:17, Jean-Sébastien Pédron wrote: >> On 04.09.2015 01:37, Matt Turner wrote: >>> You need to test for this support in configure.ac. It's as simple as >>> adding a call to AX_GCC_FUNC_ATTRIBUTE in the existing alphabetized >>> list and

Re: [Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-07 Thread Jean-Sébastien Pédron
On 04.09.2015 01:37, Matt Turner wrote: >> +__attribute__((destructor)) > > You need to test for this support in configure.ac. It's as simple as > adding a call to AX_GCC_FUNC_ATTRIBUTE in the existing alphabetized > list and then a little bit of preprocessor in src/util/macros.h. (I > think you

Re: [Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-07 Thread Jean-Sébastien Pédron
On 04.09.2015 01:37, Matt Turner wrote: > You need to test for this support in configure.ac. It's as simple as > adding a call to AX_GCC_FUNC_ATTRIBUTE in the existing alphabetized > list and then a little bit of preprocessor in src/util/macros.h. Should the code fallbacks on atexit(3) if the

Re: [Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-07 Thread Jose Fonseca
On 07/09/15 10:17, Jean-Sébastien Pédron wrote: On 04.09.2015 01:37, Matt Turner wrote: You need to test for this support in configure.ac. It's as simple as adding a call to AX_GCC_FUNC_ATTRIBUTE in the existing alphabetized list and then a little bit of preprocessor in src/util/macros.h.

[Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-03 Thread Jean-Sébastien Pédron
... to free the ralloc context at program exit. On Linux, atexit(3) handlers are called when the program exits but also when a library is unloaded. The latter behavior is a Glibc extension. On systems where this extension is not supported, this causes an application to crash when, for instance,

Re: [Mesa-dev] [PATCH] ralloc: Use __attribute__((destructor)) instead of atexit(3)

2015-09-03 Thread Matt Turner
On Thu, Sep 3, 2015 at 11:07 AM, Jean-Sébastien Pédron wrote: > ... to free the ralloc context at program exit. > > On Linux, atexit(3) handlers are called when the program exits but also > when a library is unloaded. The latter behavior is a Glibc extension. >