Messages in this thread | | | Date | Thu, 06 Jul 2000 00:59:57 +1000 | From | Andrew Morton <> | Subject | Re: [RFC] solution for the inet_ntoa problem, buffer allocator |
| |
Keith Owens wrote: > > On Wed, 05 Jul 2000 14:08:49 +0200, > Olaf Titz <olaf@bigred.inka.de> wrote: > >Each buffer is tagged > >with the return address of the caller (here called "scope"). A buffer > >is considered free when its scope doesn't match the current one. > > Double check that __builtin_return_address() gives correct results with > and without frame pointers. There are reports that it gives incorrect > data on some versions of gcc when the kernel is compiled with > -fomit-frame-pointer.
gcc-2.7.2.3/x86:
#include <stdio.h>
main() { foo(42); }
foo(int a) { printf("foo: %p\n", __builtin_return_address(0)); }
With gcc -O2 -S -fomit-frame-pointer:
foo: pushl 4(%esp) ^^^^^^^^^^^^^ Pushes the value of the first argument
pushl $.LC0 call printf addl $8,%esp ret
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |