|

 |
c++ ÀÇ Æ÷ÀÎÅÍ µ¥ÀÌÅ͸¦ c# À¸·Î Àü´ÞÇϱâ
http://yamecoder.tistory.com/301
¾Èµå·ÎÀ̵å
package com.neo.mmfplugin;
import java.io.IOException;
import android.os.MemoryFile;
import android.util.Log;
public class MMF {
private static MemoryFile _mf = null;
public static boolean Create( String name, int size)
{
if(_mf != null)
return false;
boolean res = true;
try
{
_mf = new MemoryFile( name, size);
}
catch (IOException e)
{
Log.i("MMF", "MMF FAILED");
Log.i("MMF", e.toString());
res = false;
}
Log.i("MMF", "MMF OK");
return res;
}
public static void Release()
{
if(_mf != null)
{
Log.i("MMF", "MMF Release ");
_mf.close();
}
}
public static byte [] ReadBytes( int count)
{
if( _mf == null)
return null;
boolean res = true;
byte [] byteArray = new byte [count];
try
{
_mf.readBytes(byteArray, 0, 0, count);
}
catch (IOException e)
{
//Log.i("MMF", e.toString());
res = false;
}
if(res == true)
{
//Log.i("MMF", "MMF Read OK");
}
else
{
//Log.i("MMF", "MMF Read FAILED");
}
return byteArray;
}
private static int byteArrayToInt(byte [] bytes, int n)
{
return ((((int)bytes[n + 0] & 0xff) << 24) |
(((int)bytes[n + 1] & 0xff) << 16) |
(((int)bytes[n + 2] & 0xff) << 8) |
(((int)bytes[n + 3] & 0xff)));
}
public static boolean WriteBytes( byte [] byteArray, int count)
{
if( _mf == null)
return false;
boolean res = true;
try
{
_mf.writeBytes(byteArray, 0, 0, count);
}
catch (IOException e)
{
//Log.i("MMF", e.toString());
res = false;
}
return res;
}
}
========================================================================
IOS
http://www.gnu.org/software/libc/manual/html_node/Memory_002dmapped-I_002fO.html
mmap munmap
https://github.com/Appboy/appboy-unity-sdk/blob/master/unity-samples/iOS/Roll-A-Ball-Ios/Libraries/libil2cpp/include/os/MemoryMappedFile.h
http://beej.us/guide/bgipc/output/html/multipage/mmap.html
"MAP_SHARED PROT_WRITE mmap" °Ë»ö
http://www.avrfreaks.net/forum/adding-memory-mapped-io?page=all
http://blog.daum.net/ehclub/681
http://blog.daum.net/ehclub/681
"shm_open" °Ë»ö
https://gist.github.com/jverkoey/2985830
http://egloos.zum.com/purewell/v/3078937
http://tip.daum.net/openknow/13056111?q=shm_open
http://iphonedevwiki.net/index.php/GSCapability
http://www.qnx.com/developers/docs/6.3.0SP3/neutrino/lib_ref/s/shm_open.html |
|
|