getting address of live function to pass into my Func<>

13 views
Skip to first unread message

Hayden Livingston

unread,
Jun 30, 2015, 2:35:02 AM6/30/15
to asmji...@googlegroups.com
I'm writing code to be able to do the following:

Func<somePointer, somePointer2, somePointer3>()
{
    MakeACall(somePointer, somePointer2>();
}

The MakeACall is a static function in my program. How do I call it? I mean, how do I get the live pointer address, which is what I think AsmJit needs?


Petr Kobalíček

unread,
Jun 30, 2015, 5:45:32 AM6/30/15
to asmji...@googlegroups.com
Hi Hayden, I guess casting to void* would give you what you need:

  `(void*)someFunction`

Alternatively you can use `asmjit::imm_ptr()`:

  `imm_ptr(someFunction)`

which will do the cast for you.

Hope that helps
Petr

--

---
You received this message because you are subscribed to the Google Groups "asmjit-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asmjit-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages