[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    Re: [PATCH 2/5] os: use a constant for backtrace array size
From:       walter harms <wharms () bfs ! de>
Date:       2013-10-31 15:59:20
Message-ID: 52727E58.4070403 () bfs ! de
[Download RAW message or body]



Am 30.10.2013 00:25, schrieb Peter Hutterer:
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> ---
>  os/backtrace.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/os/backtrace.c b/os/backtrace.c
> index 426f9b1..3d1195b 100644
> --- a/os/backtrace.c
> +++ b/os/backtrace.c
> @@ -114,14 +114,15 @@ xorg_backtrace(void)
>  void
>  xorg_backtrace(void)
>  {
> -    void *array[64];
> +    const int BT_SIZE = 64;
> +    void *array[BT_SIZE];
>      const char *mod;
>      int size, i;
>      Dl_info info;
>  

Your intentions are good but personaly i find this is confusing.
The std.way is to use a #define BT_SIZE  64

re,
 wh

>      ErrorFSigSafe("\n");
>      ErrorFSigSafe("Backtrace:\n");
> -    size = backtrace(array, 64);
> +    size = backtrace(array, BT_SIZE);
>      for (i = 0; i < size; i++) {
>          int rc = dladdr(array[i], &info);
>  
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic