public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] dynamic allocation  memory
@ 2000-09-06  0:10 pengyu xue
  2000-09-06  0:30 ` Andrew Lunn
  2000-09-06  5:17 ` Gary Thomas
  0 siblings, 2 replies; 3+ messages in thread
From: pengyu xue @ 2000-09-06  0:10 UTC (permalink / raw)
  To: ecos-discuss

Hi, all:
 
         I use the malloc function in my device driver, but it seems
something is wrong with this function. So I wonder that ecos-131 support
the dynamic memory allocation in the target vrc4300-4373.  Can someone
tell me more information about this? And I used  memory pool, the same
result I meet. How to use the memory pool functions?
         Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] dynamic allocation  memory
  2000-09-06  0:10 [ECOS] dynamic allocation memory pengyu xue
@ 2000-09-06  0:30 ` Andrew Lunn
  2000-09-06  5:17 ` Gary Thomas
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2000-09-06  0:30 UTC (permalink / raw)
  To: pengyu xue; +Cc: ecos-discuss

> Hi, all:
>  
>          I use the malloc function in my device driver, but it seems
> something is wrong with this function. 

You say device driver. Do you mean ISR and DSR? If so, its a bad idea
to use malloc. malloc will need to use some sort of mutex primitive to
protect its data structures from multiple threads executing it
simultaniously. ISR and DSR cannot block so these primitives don't
work. 

Somewhere there is a document which states which functions you can
call in a DSR/ISR. For mempools the try get function will probably
work, but you have to be prepaired for it to return no memory.

        Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [ECOS] dynamic allocation  memory
  2000-09-06  0:10 [ECOS] dynamic allocation memory pengyu xue
  2000-09-06  0:30 ` Andrew Lunn
@ 2000-09-06  5:17 ` Gary Thomas
  1 sibling, 0 replies; 3+ messages in thread
From: Gary Thomas @ 2000-09-06  5:17 UTC (permalink / raw)
  To: pengyu xue; +Cc: ecos-discuss

On 06-Sep-2000 pengyu xue wrote:
> 
> Hi, all:
>  
>          I use the malloc function in my device driver, but it seems
> something is wrong with this function. So I wonder that ecos-131 support
> the dynamic memory allocation in the target vrc4300-4373.  Can someone
> tell me more information about this? And I used  memory pool, the same
> result I meet. How to use the memory pool functions?

What does 'something is wrong' mean?  Does it work at all?  Do you run
out of malloc memory before you think you should?  We'll need more data
before we can help much.

As was also pointed out, calling malloc() in an ISR or even DSR is probably
not a really good idea.  Can you tell us more about what you're trying to
do?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-09-06  5:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-06  0:10 [ECOS] dynamic allocation memory pengyu xue
2000-09-06  0:30 ` Andrew Lunn
2000-09-06  5:17 ` Gary Thomas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).