Possible problem with malloc_free_space using ss-20021007?
Joel Sherrill
joel.sherrill at OARcorp.com
Tue Oct 29 13:34:47 UTC 2002
Fabrizio Pirovano wrote:
>
> I am not sure if this patch can solve your problem but I found a little bug
> in regiongetinfo.c function
> (see attached file).
Yep. Looks like a minor bug to me. I think it would have resulted in
the information being returned and you getting an RTEMS_INVALID_ADDRESS
error.
And unfortunately, malloc_free_space
(cpukit/libcsupport/src/mallocfreespace.c)
compensated for this with similarly reversed logic. ;(
if ( !rtems_region_get_information( RTEMS_Malloc_Heap, &heap_info ) )
{
return (size_t) heap_info.free_size;
}
return (size_t) -1;
> With this, I obtain good result on my target.
Any idea how it is getting by the backwards check in mallocfreespace.c?
> Best regards
> Fabrizio Pirovano
>
> ----- Original Message -----
> From: "Joel Sherrill" <joel.sherrill at OARcorp.com>
> To: "Bob Wisdom" <bobwis at ascweb.co.uk>
> Cc: "rtems-users (list)" <rtems-users at oarcorp.com>
> Sent: Monday, October 28, 2002 11:51 PM
> Subject: Re: Possible problem with malloc_free_space using ss-20021007?
>
> >
> >
> > Bob Wisdom wrote:
> > >
> > > Further to my last post on stack check reporting possibly going wrong I
> have
> > > another one to add:-
> > > printf("malloc free space = %xl\n",(unsigned long)malloc_free_space());
> > > seems to give unreal numbers..
> > > Anyone else get this, or am I really messed up?!
> >
> > What's an unreal number and how much RAM is on your target?
> >
> > > Thanks to all.
> > > Bob Wisdom
> >
> > --
> > Joel Sherrill, Ph.D. Director of Research & Development
> > joel at OARcorp.com On-Line Applications Research
> > Ask me about RTEMS: a free RTOS Huntsville AL 35805
> > Support Available (256) 722-9985
> >
>
> ------------------------------------------------------------------------
> Name: regiongetinfo.diff
> regiongetinfo.diff Type: unspecified type (application/octet-stream)
> Encoding: quoted-printable
--
Joel Sherrill, Ph.D. Director of Research & Development
joel at OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985
More information about the users
mailing list