github.com/qioalice/ekago/v3@v3.3.2-0.20221202205325-5c262d586ee4/ekaunsafe/ekaclike.go (about)

     1  // Copyright © 2020. All rights reserved.
     2  // Author: Ilya Stroy.
     3  // Contacts: iyuryevich@pm.me, https://github.com/qioalice
     4  // License: https://opensource.org/licenses/MIT
     5  
     6  package ekaunsafe
     7  
     8  import (
     9  	"unsafe"
    10  
    11  	"github.com/qioalice/ekago/v3/internal/ekaclike"
    12  )
    13  
    14  // To see docs and comments,
    15  // navigate to the origin package.
    16  
    17  type (
    18  	Interface = ekaclike.Interface
    19  )
    20  
    21  func UnpackInterface(i any) Interface {
    22  	return ekaclike.UnpackInterface(i)
    23  }
    24  
    25  func TakeRealAddr(i any) unsafe.Pointer {
    26  	return ekaclike.TakeRealAddr(i)
    27  }
    28  
    29  func TakeCallableAddr(i any) unsafe.Pointer {
    30  	return ekaclike.TakeCallableAddr(i)
    31  }
    32  
    33  func Addr2Callable(realPtr unsafe.Pointer) (callablePtr unsafe.Pointer) {
    34  	return ekaclike.Addr2Callable(realPtr)
    35  }
    36  
    37  func Addr2Real(callablePtr unsafe.Pointer) (realPtr unsafe.Pointer) {
    38  	return ekaclike.Addr2Real(realPtr)
    39  }