[IronPython] memoryview / passing string data to a C functionwithout copying

Markus Schaber m.schaber at 3s-software.com
Wed Jun 1 08:01:11 CEST 2011

Hi, Peter,

> Von: users-bounces at lists.ironpython.com [mailto:users-
>      Does anyone know how to pass the contents of a string to a C
> without copying it?

A non-pythonic suggestion:

Maybe you could use the .NET System.FileStream to read the data into a
byte array (or a .NET memory stream), and pass that one to the cFunc?

Or you wait for IronPython 3 which has better support for byte data.

Best regards

Markus Schaber

We software Automation.

3S-Smart Software Solutions GmbH
Markus Schaber | Developer
Memminger Str. 151 | 87439 Kempten | Germany | Tel. +49-831-54031-0 |
Fax +49-831-54031-50

Email: m.schaber at 3s-software.com | Web: http://www.3s-software.com 
CoDeSys internet forum: http://forum.3s-software.com
Download CoDeSys sample projects:

Managing Directors: Dipl.Inf. Dieter Hess, Dipl.Inf. Manfred Werner |
Trade register: Kempten HRB 6186 | Tax ID No.: DE 167014915

More information about the Ironpython-users mailing list