chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Memory mapped I/O and CHICKEN ports


From: Thomas Chust
Subject: Re: [Chicken-users] Memory mapped I/O and CHICKEN ports
Date: Sat, 04 Dec 2004 19:46:51 +0100
User-agent: Mozilla Thunderbird 0.8 (X11/20040918)

felix winkelmann wrote:
[...]

What you currently do is copy the data into a buffer and
write it then into the port, right?
There is no way to write contents pointed to by a pointer directly,
unless you fetch and write the data explicitly (either by character,
block-wise or in one go).
Could you give some more information? Is the file to big, is the
operation too slow, or is the interface to awkward?

[...]

Hello,

currently I just open the file normally, read it blockwise into a string buffer and (display ...) it on the target port. This of course works fine for all kinds and sizes of files. But for relatively large files, it would be much faster to just map the file into address space and to somehow tell CHICKEN to push everything in the mapped memory region through the given port. If I copy the data from the mapped region to a buffer though, I lose the whole speed and memory footprint advantage that I might have had by using mmap!

Isn't there some dirty trick to coerce a foreign pointer together with length information into a CHICKEN string? I think that would be a good solution.

Ciao,
Thomas





reply via email to

[Prev in Thread] Current Thread [Next in Thread]