We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
my problem is how to use malloc or free function in interrupt function,because the function like malloc() or free() is non_reentrant.But i have to do it in interrupt function to save memory. what shall i do? please help me! i use timer0 to free the memory when memeory is no applied,but after three times,the timero is closed auto. regards!! thanks !!
You should very seriously re-think that plan from the ground up. Most embedded application should never use malloc() at all. And definitely not in an interrupt service routine. That's just begging for trouble. You can't free() memory from under the feet of a C program by doing it inside an ISR. That will certainly cause more problems than it can ever solve. If you want to conserve memory, don't use malloc() at all. Used fixed-size buffers where you need them.
Do you think you get better answers, sorry, answers more to your liking, by posting twice? Erik