Exemplo n.º 1
0
 public void NativeFree(IntPtr nat)
 {
     if (nat != IntPtr.Zero)
     {
         MemoryNative.Free(nat);
     }
 }
Exemplo n.º 2
0
        /// <summary>Returns an enumerator that iterates throught this accessor.</summary>
        /// <returns>An enumerator to walk through the acessor items.</returns>
        public IEnumerator <T> GetEnumerator()
        {
            if (Handle == IntPtr.Zero)
            {
                throw new ObjectDisposedException(base.GetType().Name);
            }

            IntPtr tmp      = MemoryNative.Alloc(Marshal.SizeOf(typeof(IntPtr)));
            uint   position = 0;

            try
            {
                while (eina_accessor_data_get(Handle, position, tmp))
                {
                    IntPtr data = (IntPtr)Marshal.PtrToStructure(tmp, typeof(IntPtr));
                    yield return(Convert(data));

                    position += 1;
                }
            }
            finally
            {
                MemoryNative.Free(tmp);
            }
        }
Exemplo n.º 3
0
 public void NativeFree(IntPtr nat)
 {
     if (nat != IntPtr.Zero)
     {
         MemoryNative.DelStringshare(nat);
     }
 }
Exemplo n.º 4
0
 protected virtual void Dispose(bool disposing)
 {
     if (!Disposed && ShouldFree)
     {
         MemoryNative.Free(this.Handle);
     }
     Disposed = true;
 }
Exemplo n.º 5
0
        public IntPtr ManagedToNativeAllocInlistNode(T man)
        {
            var node = new InlistNode <IntPtr>();

            node.Val = ManagedToNativeAlloc(man);
            GCHandle pinnedData = GCHandle.Alloc(node, GCHandleType.Pinned);
            IntPtr   ptr        = pinnedData.AddrOfPinnedObject();
            IntPtr   nat        = MemoryNative.AllocCopy(ptr, Marshal.SizeOf <InlistMem>() + Marshal.SizeOf <IntPtr>());

            pinnedData.Free();
            return(nat);
        }
Exemplo n.º 6
0
 public void NativeFreeInlistNode(IntPtr nat, bool freeElement)
 {
     if (nat == IntPtr.Zero)
     {
         return;
     }
     if (freeElement)
     {
         NativeFreeInlistNodeElement(nat);
     }
     MemoryNative.Free(nat);
 }
Exemplo n.º 7
0
        public static IntPtr ManagedStringToNativeUtf8Alloc(string managedString)
        {
            if (managedString == null)
            {
                return(IntPtr.Zero);
            }

            byte[] strbuf = Encoding.UTF8.GetBytes(managedString);
            IntPtr native = MemoryNative.Alloc(strbuf.Length + 1);

            Marshal.Copy(strbuf, 0, native, strbuf.Length);
            Marshal.WriteByte(native + strbuf.Length, 0); // write the terminating null
            return(native);
        }
Exemplo n.º 8
0
 public IntPtr EinaFreeCb()
 {
     return(MemoryNative.FreeFuncPtrGet());
 }
Exemplo n.º 9
0
 public void NativeFreeInlistNode(IntPtr nat, bool freeElement)
 {
     MemoryNative.Free(nat);
 }
Exemplo n.º 10
0
 public void NativeFree(IntPtr nat)
 {
     MemoryNative.Free(nat);
 }
Exemplo n.º 11
0
 public IntPtr EinaFreeCb()
 {
     return(MemoryNative.EflUnrefFuncPtrGet());
 }
Exemplo n.º 12
0
 public IntPtr EinaCompareCb()
 {
     return(MemoryNative.PtrCompareFuncPtrGet());
 }
Exemplo n.º 13
0
 public IntPtr EinaHashNew()
 {
     return(eina_hash_stringshared_new(MemoryNative.StringshareDelFuncPtrGet()));
 }
Exemplo n.º 14
0
 public IntPtr EinaFreeCb()
 {
     return(MemoryNative.StringshareDelFuncPtrGet());
 }
Exemplo n.º 15
0
 public void NativeFreeInplace(IntPtr nat)
 {
     MemoryNative.DelStringshareRef(nat);
 }
Exemplo n.º 16
0
        public IntPtr ManagedToNativeAlloc(Eina.Stringshare man)
        {
            var strShare = MemoryNative.AddStringshare(man);

            return(strShare);
        }
Exemplo n.º 17
0
 public void NativeFreeInplace(IntPtr nat)
 {
     MemoryNative.FreeRef(nat);
 }
Exemplo n.º 18
0
 public IntPtr ManagedToNativeAlloc(T man)
 {
     return(MemoryNative.StrDup((string)(object)man));
 }
Exemplo n.º 19
0
        public IntPtr ManagedToNativeAlloc(string man)
        {
            IntPtr newstring = MemoryNative.StrDup(man);

            return(newstring);
        }