Mon, 03 Jul 2000 Tobias Klotz wrote:
> Hello,
> 
> I have a problem concerning the use of rtf_put using it like this:
> 
> my_mem=new whatever;
> rtf_put (FIFO, my_mem, sizeof(whatever))
> delete whatever;

If you're doing this from within an RTL thread or ISR, that explains the
problems. (I assume you're using one of the "C++ in kernel space" solutions
posted here.) The new and delete operators will indirectly call the kernel
memory manager, which will eventually crash, since it doesn't handle
preemption from RTL.

You have to preallocate any memory you need in the RT threads and ISRs in
init_module() or some other code that runs as a normal (non RTL) kernel
thread. If you really need dynamic memory management, you could hack your own
memory manager with a preallocated, non-swappable heap. A LIFO stack of
equally sized blocks is a fast and simple way.


David Olofson
 Programmer
 Reologica Instruments AB
 [EMAIL PROTECTED]

..- M u C o S --------------------------------. .- David Olofson ------.
|           A Free/Open Multimedia           | |     Audio Hacker     |
|      Plugin and Integration Standard       | |    Linux Advocate    |
`------------> http://www.linuxdj.com/mucos -' | Open Source Advocate |
..- A u d i a l i t y ------------------------. |        Singer        |
|  Rock Solid Low Latency Signal Processing  | |      Songwriter      |
`---> http://www.angelfire.com/or/audiality -' `-> [EMAIL PROTECTED] -'
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to