So I managed to port all C++ functions to pharo, which basically includes
the following

Not full definition of function

open()
lseek()
close()
mmap()

I have tested them all, they all return proper values from inside Pharo and
Pharo does not crash.

it seems also that mmap works because it returns a void pointer as it
should. This pointer points to the shared memory where I have put the
string "hello" from another C++ program that has shared the memory .

So how can from Pharo take the void pointer

"(void*)@ 16rFFFFFFFF"

and retrieve the string "hello" that it points to ?

Essentially I want to dereference the pointer

I tried to send the message fromCString to the void pointer (ExternalData)
but it crashed Pharo.

Another question, is it possible to cast a pointer ? (I do this with C++
programm)
so can I cast from pharo the void pointer to a string pointer ?

I have also no idea if the void pointer points to a proper memory address ,
the documentation says that all pointers live in head but I have no way to
confirm this.

I am so close to sharing memory between Pharo and C++ that I can smell it
:D

Reply via email to