rhdunn / cainteoir-engine

The Cainteoir Text-to-Speech core engine
http://reecedunn.co.uk/cainteoir/
GNU General Public License v3.0
43 stars 8 forks source link

Create an open_memstream compatiblity layer #61

Open rhdunn opened 10 years ago

rhdunn commented 10 years ago

On systems that do not support open_memstream a temporary file is created. While this works, it is slower than using the in-memory version.

BSD-based systems (including Android and Mac OS) have funopen that allows creating custom FILE objects. There are various open_memstream compatibility layers available, e.g.:

  1. https://code.google.com/p/tesseract-android-tools/source/browse/tesseract-android-tools/jni/com_googlecode_leptonica_android/stdio/open_memstream.c?r=f5c859a3bd7cd1e1efba38050fb6b79244971df9
  2. https://github.com/shyuep/pyhull/tree/master/src/fmemopen

Adapting one of these will allow in-memory file stream support on more platforms (i.e. everything other than Windows).

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2796597-create-an-open_memstream-compatiblity-layer?utm_campaign=plugin&utm_content=tracker%2F254961&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F254961&utm_medium=issues&utm_source=github).