Dear Sir madams,
we wish use linklist to effishiently sort data then build tree in are controllar.
In your humble oppionion,it is wong use malloc,calloc and realloc in 8051?
Can you advise? It first year in industry after study in Beijing.
Worry I make mistak
Xin Nian Kuai Le
But you do still need to know the maximum size at compile time - because you have to define the heap size!
So, given that you have to fix the heap size at build time anyhow, you might just as well define the data structures "statically".
As has already been mentioned, it is not necessary to use dynamic allocation in order to use linked lists!
It is perfectly fine to define a static set of list entries, and simply link them into an "in-use" list or a "free" list as & when required at runtime.
That gives you all the convenience of linked lists with none of the risks & overheads of dynamic allocation.
Of course, the 8051 is still not a great choice for a "data processing" task like this; an ARM would probably be a better choice - and may well be no more expensive...