lkml.org 
[lkml]   [2008]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Fix max-stack calculators to skip canary
Joe Perches wrote:

> Wouldn't it be better to have exactly the same code?
> How about using a statement expression macro?
>
> #define DEBUG_STACK_FREE(process) \
> ({ \
> unsigned long *n = end_of_stack(process); \
> do { /* Skip over canary */\
> n++; \
> } while (!*n); \
> (unsigned long)n - (unsigned long)end_of_stack(process); \
> })
>

That'd probably be good although I don't think we like macros anymore :)

-Eric


\
 
 \ /
  Last update: 2008-04-22 20:13    [W:0.044 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site