Bob Ammerman wrote: > Careful use of dynamically allocated memory can make sense in an embedded > application. As examples, I will document the way dynamic memory is used in > three large embedded systems I have developed (one in assembler, one in C > and one in C++) that all use carefully managed dynamic memory allocation. It > is interesting to note that several techniques, as outlined below, can be > used to avoid the twin bugaboos of fragmentation and memory exhaustion. > Admittedly all of these systems have much more memory than a PIC. Note that the three examples you cite do not use 'general' malloc/free-style dynamic memory. Did you use a compiler-provided (C-style) malloc at all? I understand that you certainly did not use free. In all three cases you took explicit action to avoid fragmentation. Except for the double-pointer example approach one could argue that (in the other two) you don't use dynamic memory at all: you might as well have used one or more statically allocated arrays and hand out (and take back) array entries. -- Wouter van Ooijen -- ------------------------------------------- Van Ooijen Technische Informatica: www.voti.nl consultancy, development, PICmicro products docent Hogeschool van Utrecht: www.voti.nl/hvu -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist