Forum : 8051
Original Post
Post Information | Post |
---|---|
April 9, 2007 - 12:41pm
|
Hi everybody!! I am trying to use the function malloc() in a program: puntero_aux=malloc(size); Could someone helps me? I don't know if I can use this function with 8051?? I need to store a variable number of bytes and I need to pointer to the first byte to read it, after to the second,... |
I don't know if I can use this function with 8051??
you 'can' but not if you want any execution speed to speak of. The '51 architecture is such that implementing malloc will give you coding that is very ineffective.
I need to store a variable number of bytes
why not just have an array that can hold the max number of bytes/
Erik
Thanks Erik!
I have used malloc() with my training board and it works(the speed is not a big prolblem at the moment) but I have one doubt, with kind of data is the pointer that retrun x=(BYTE*) malloc()? because I am trying to see the value through serial port in my PC but the value is not correct.
Santi
why not just drop malloc and avoid all problems?
yes, maybe I will drop malloc()
Thanks
Santi