[En-Nut-Discussion] How much memory is still available in the stack of a thread?

Rodrigue rodrigue.roland at gmail.com
Tue Apr 24 16:59:04 CEST 2007


I'm not sure but may be by using the variable runningThread:
   u_int avaiblememory =  (uptr_t) runningThread->td_sp - (uptr_t)
runningThread->td_memory;

with uptr_t td_sp;               /*!< \brief Stack pointer. */
     u_char *td_memory;          /*!< \brief Pointer to heap memory used for
stack. */

Does each thread has is own heap memory? I tought that it was global and
located at the end of the external memory growing downwards...

Could somebody confirm, please? It's very urgent...



Rodrigue wrote:
> 
> Hello,
> 
> Is it possible to know how much memory is still available in the stack of
> a thread?
> In particular, may be, with the structure NUTTHREADINFO?
> 
> Thanks a lot in advance!
> 

-- 
View this message in context: http://www.nabble.com/How-much-memory-is-still-available-in-the-stack-of-a-thread--tf3639143.html#a10162630
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.




More information about the En-Nut-Discussion mailing list