public inbox for ecos-patches@sourceware.org
 help / color / mirror / Atom feed
* Fix for memory leak in profiling
@ 2008-03-10 13:45 Øyvind Harboe
  2008-03-10 14:04 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Øyvind Harboe @ 2008-03-10 13:45 UTC (permalink / raw)
  To: eCos Disuss

[-- Attachment #1: Type: text/plain, Size: 75 bytes --]

-- 
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA  developer kit

[-- Attachment #2: fixleak.txt --]
[-- Type: text/plain, Size: 1659 bytes --]

### Eclipse Workspace Patch 1.0
#P ecos
Index: services/profile/gprof/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/services/profile/gprof/current/ChangeLog,v
retrieving revision 1.9
diff -u -r1.9 ChangeLog
--- services/profile/gprof/current/ChangeLog	21 Dec 2007 16:47:15 -0000	1.9
+++ services/profile/gprof/current/ChangeLog	10 Mar 2008 13:45:01 -0000
@@ -1,3 +1,7 @@
+2008-03-10  Oyvind Harboe  <oyvind.harboe@zylin.com>
+	
+	* src/profile.c: plug memory leak.
+	
 2007-12-14  Oyvind Harboe  <oyvind.harboe@zylin.com>
 2007-12-21  Jonathan Larmour  <jifl@eCosCentric.com>
 
Index: services/profile/gprof/current/src/profile.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/services/profile/gprof/current/src/profile.c,v
retrieving revision 1.6
diff -u -r1.6 profile.c
--- services/profile/gprof/current/src/profile.c	21 Dec 2007 16:47:15 -0000	1.6
+++ services/profile/gprof/current/src/profile.c	10 Mar 2008 13:45:01 -0000
@@ -577,10 +577,15 @@
 
     profile_enabled = 1;
 
-#ifdef CYGPKG_PROFILE_TFTP    
-    // Create a TFTP server to provide the data
-    // invoking this a second time is harmless
-    (void) tftpd_start(CYGNUM_PROFILE_TFTP_PORT, &profile_tftp_fileops);
+#ifdef CYGPKG_PROFILE_TFTP
+    static int launched = 0;
+    if (!launched)
+    {
+    	launched = 1;
+	    // Create a TFTP server to provide the data
+	    // invoking this a second time is harmless
+	    (void) tftpd_start(CYGNUM_PROFILE_TFTP_PORT, &profile_tftp_fileops);
+    }
 #endif    
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix for memory leak in profiling
  2008-03-10 13:45 Fix for memory leak in profiling Øyvind Harboe
@ 2008-03-10 14:04 ` Andrew Lunn
  2008-03-10 14:05   ` Øyvind Harboe
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2008-03-10 14:04 UTC (permalink / raw)
  To: ?yvind Harboe; +Cc: eCos Disuss

Hi Oyvind

I think a better fix is to make profile_off() call tftpd_stop().

  Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Fix for memory leak in profiling
  2008-03-10 14:04 ` Andrew Lunn
@ 2008-03-10 14:05   ` Øyvind Harboe
  0 siblings, 0 replies; 3+ messages in thread
From: Øyvind Harboe @ 2008-03-10 14:05 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: eCos Disuss

On Mon, Mar 10, 2008 at 3:03 PM, Andrew Lunn <andrew@lunn.ch> wrote:
> Hi Oyvind
>
>  I think a better fix is to make profile_off() call tftpd_stop().

OK. I'm not familiar with tftpd_stop(), but it sounds right to me.

>
>   Andrew
>



-- 
Øyvind Harboe
http://www.zylin.com - eCos ARM & FPGA  developer kit

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-03-10 14:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-10 13:45 Fix for memory leak in profiling Øyvind Harboe
2008-03-10 14:04 ` Andrew Lunn
2008-03-10 14:05   ` Øyvind Harboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).