-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,
I understand your concerns and there is no use of alloc after the initialization phase in my code. Malloc is used because the code runs on bigger CPUs also and it was a test to see how big the code is on a MSP430. Peter On Thu, 10 Jul 2003 15:05:22 -0400 "J.C. Wren" <[email protected]> wrote: > malloc() and alloc() (and their general concept) in any embedded > system are > generally considered a bad idea, since it can lead to memory > fragmentation and starvation. > > Considering a system with 8K of memory. You allocate 4 2K blocks, > free the > 1st and 3rd, then try to allocate 4K. There's 4K free, but it's not > contiguous. > > Most embedded systems, particularly those without an MMU or an > automatic > garbage collection mechanism (Java, some others), are not recommended > for typical dynamic memory allocations. They can also be expensive, > particularly if you have a number of allocated blocks and the block list > has to be traversed, or you malloc/free a lot. > > --John > > On Thursday 10 July 2003 11:35 am, Daniel Néri wrote: > > Peter Mueller <[email protected]> writes: > > > /cygdrive/c/mspgcc/lib/gcc-lib/msp430/3.2.3/../../../../msp430/lib/ > > > msp2/l > > >ibc.a(m alloc.o)(.text+0x1e): In function `malloc': > > > /cygdrive/c/mspgcc-source/msp430/msp430-libc/src/stdlib/malloc.c:21: > > > internal er > > > ror: unsupported relocation error > > > > Sorry, I've never used malloc on MSP430, and I guess most others don't > > use it either. It isn't very useful when you only have 2 kilobytes of > > RAM (or less) to play with. > > > > Can't you change your code to use statically allocated memory instead? > > > > > > Regards, > > --Daniel > > > > > > > > ------------------------------------------------------- > > This SF.Net email sponsored by: Parasoft > > Error proof Web apps, automate testing & more. > > Download & eval WebKing and get a free book. > > www.parasoft.com/bulletproofapps > > _______________________________________________ > > Mspgcc-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Parasoft > Error proof Web apps, automate testing & more. > Download & eval WebKing and get a free book. > www.parasoft.com/bulletproofapps1 > _______________________________________________ > Mspgcc-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mspgcc-users > - -- Peter Mueller [email protected] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/D8tvUzCcwYQMTJoRAjgmAJ9uLwMY911sgRjU01yDMuFz/qQuJACeKAO1 j6Doe99g0F7tTqXz8ivIJSk= =LLgr -----END PGP SIGNATURE-----
