This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: Fix BSD Memory Leak
On Tue, 2003-07-29 at 01:51, Andrew Lunn wrote:
> Hi Nick, Gary
>
> I was looking at this patch and decide to look back at the original
> FreeBSD code to see how they fixed the memory leak. But i've run into
> a problem. There is no src/sys/kern/sockio.c in the FreeBSD sources.
>
This is an adaptation of "sys/kern/uipc_syscalls.c", which was
replaced/reworked when the new file I/O interfaces came about.
The patch looks proper to me.
> Since your names are in the author & contributer sections, please
> could you tell me what the history is of this file.
>
> Thanks
> Andrew
>
>
>
> On Mon, Jul 28, 2003 at 11:04:02AM -0700, Jay Foster wrote:
> > The attached patch fixes a memory leak in the BSD stack for eCos. The
> > accept() call would leak 48 bytes on each call. The exact number of bytes
> > leaked could vary on different platforms, as it depends on the amount of
> > roundup done for alignment issues. On my platform ARM7TDMI, it was 32 bytes
> > + 16 (for roundup).
> >
> > I also moved the splx(s) statement into the 'else' case of the conditional
> > compile, since it corresponds with the splx() call in the 'if' portion of
> > the conditional compile.
> >
> > Jay Foster
> > <<bsd_accept_leak_fix.pat>>
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates