chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] Best way to share memory between C and Chicken


From: Dan Leslie
Subject: Re: [Chicken-users] Best way to share memory between C and Chicken
Date: Fri, 03 May 2013 11:10:11 -0700
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2

If it's heterogeneous data I tend to use blobs with helper functions to cast segments to records without undertaking a copy.
https://wiki.call-cc.org/man/4/Unit%20library#blobs

If it's homogenous data then the srfi-4 unit provides all sorts of vectors that you can use.
https://wiki.call-cc.org/man/4/Unit%20srfi-4

Keep in mind that foreign-lambdas will take blob and srfi-4 vectors as parameter types and convert them to their relevant C types without undertaking a copy.
https://wiki.call-cc.org/man/4/Accessing%20external%20objects

-Dan

On 5/3/2013 11:04 AM, Pedro Melendez wrote:

Hi all,

Sorry if this question is obvious, but I couldn't find what I were looking for in the documentation so maybe you guys can help me.

I am developing a prototype of a server that would serve 3D seismic images across the network. This  task requires to process big files (~4 GB) with existing C code that is desirable to maintain. I plan to write the server itself in Chicken scheme but I would need to maintain the existing code in C that opens and process those files.

Giving the size of the file, I want to share the memory space between C and Chicken and avoid copying values between areas. Is that even possible? Anyone has an idea on how can I address this?

Thanks in advance!

Pedro

--
T: +1 (416) - 357.5356
Skype ID: pmelendezu




_______________________________________________
Chicken-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/chicken-users


reply via email to

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