|
From: Sharma Anurag-D. <anu...@mo...> - 2007-10-22 20:42:35
|
On this page http://www.brainmurders.demon.co.uk/omega.html there is an example about the omega and memcheck output for the following sample of code. 01 #include <stdlib.h> 02 =20 03 static void func1(void) 04 { 05 char *pointer =3D 0; 06 =20 07 pointer =3D malloc(64); 08 =20 09 return; 10 } /* Leak report here */ 11 =20 12 int main(int argc, char *argv[]) 13 { 14 func1(); 15 =20 16 return 0; 17 } 18 =20 =20 My question in this case is, if the variable pointer is defined globally just like below, then what wil be the output from omega and memcheck ? =20 01 #include <stdlib.h> 02 char *pointer =3D 0; 03 static void func1(void) 04 { 05 06 =20 07 pointer =3D malloc(64); 08 =20 09 return; 10 } /* Leak report here */ 11 =20 12 int main(int argc, char *argv[]) 13 { 14 func1(); 15 =20 16 return 0; 17 } 18 =20 =20 Thanks and Regards Anurag Sharma =20 |
|
From: Olly B. <ol...@su...> - 2007-10-23 02:07:50
|
On 2007-10-22, Sharma Anurag-DXGM46 <anu...@mo...> wrote:
> My question in this case is, if the variable pointer is defined globally
> just like below, then what wil be the output from omega and memcheck ?
Did you try it for yourself?
Cheers,
Olly
|
|
From: Sharma Anurag-D. <anu...@mo...> - 2007-10-25 21:03:46
|
No, I have not tried it. Has anyone noticed how Memcheck and Omega deal
with global pointers.
Anurag=20
-----Original Message-----
From: val...@li...
[mailto:val...@li...] On Behalf Of Olly
Betts
Sent: Monday, October 22, 2007 9:08 PM
To: val...@li...
Subject: Re: [Valgrind-users] Omega / Memcheck output for global
variable
On 2007-10-22, Sharma Anurag-DXGM46 <anu...@mo...> wrote:
> My question in this case is, if the variable pointer is defined=20
> globally just like below, then what wil be the output from omega and
memcheck ?
Did you try it for yourself?
Cheers,
Olly
------------------------------------------------------------------------
-
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Valgrind-users mailing list
Val...@li...
https://lists.sourceforge.net/lists/listinfo/valgrind-users
|