This is the mail archive of the crossgcc@cygnus.com mailing list for the crossgcc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: malloc


   Date: Tue, 06 Oct 1998 10:26:10 -0700
   From: Dony <dony@willowglen.com.sg>

   Hii all,
   Right now I'm doing my embedded code based on M68000 processor.
   Since that the code isn't so complex and I have also small 
   memory built in, I decide not to put any OS on the system. 
   In order to reserve space in memory for data buffer from 
   UART interface (later on will be passed to the DSP), 
   I make use of 'malloc' and 'free' function.
   As I check 'malloc' source from newlib from cygnus, mentioned
   like this :

   /* VxWorks provides its own version of malloc, and we can't use this
      one because VxWorks does not provide sbrk.  So we have a hook to
      not compile this code.  */

   Does it mean that I couldn't use this malloc if I don't implement
   VxWorks OS in the system??

Nope [that would be bizarre, wouldn't it].
Read further down in that file.

What you need to do is provide write your own sbrk
[which for the existing ports is typically done about 10 lines of C].

In the newlib and libgloss source trees run this to find examples
of how to do this.

find . -name 'sbrk*' -print


________________________________________________
To get help for the crossgcc list, send mail to
crossgcc-request@cygnus.com with the text 'help'
(without the quotes) in the body of the message.