DLL call in Smalltalk

224 views
Skip to first unread message

Gaurav Sharma

unread,
Feb 29, 2012, 9:01:26 AM2/29/12
to va-sma...@googlegroups.com
Hi,
I was going through the smalltalk code and found something a bit strange, look below -
 
"<primitive: VMprBlockContextValueOnReturnDo>"
 
I check the code and VMprBlockContextValueOnReturnDo returned a value of 181 on inspecting but could not find anything by the name primitive: aString.
What I could grasp was that this is a call to some DLL but how is the call happening and which DLL is it calling was something I could not trace.
 
Can anyone help me with this? maybe redirect me to the correct doc
 
Thanks

Marten Feldtmann

unread,
Feb 29, 2012, 9:35:48 AM2/29/12
to va-sma...@googlegroups.com

A primitive is a very special call to a native external library code.

After all its an exported external function from a shared library therefore you might look at the exported functions of some of the dlls delivered with VASmalltalk.

In this example perhaps the dll containing the virtual machine.

> --
> You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/va-smalltalk/-/KZHTfbonh_4J.
> To post to this group, send email to va-sma...@googlegroups.com.
> To unsubscribe from this group, send email to va-smalltalk...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.

John O'Keefe

unread,
Feb 29, 2012, 12:23:11 PM2/29/12
to va-sma...@googlegroups.com
Marten is exactly correct, but I will add a little additional information.
 
If the external function is located in a DLL/shared object other than the VM, then the name of the DLL/shared object will be specified (i.e. <primitive: Foo:Entry-point name>; if it is the VM, only the Entry-point name is specified (as in your example).
 
You may also find constructs that look like <c: Foo:Entry-point name> and wonder how these are different from primitives.  The implementation of <primitive: ...> takes Smalltalk objects as parameters and return a Smalltalk object as the result; the implementation of <c: ...> takes normal C parameters and answers a normal C result.
 
You can find a lot more detail on the subject at VA Smalltalk Virtual Machine API.

> To unsubscribe from this group, send email to va-smalltalk+unsubscribe@googlegroups.com.


> For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.

> To unsubscribe from this group, send email to va-smalltalk+unsubscribe@googlegroups.com.


> For more options, visit this group at http://groups.google.com/group/va-smalltalk?hl=en.

> To unsubscribe from this group, send email to va-smalltalk+unsubscribe@googlegroups.com.

Message has been deleted

Gaurav Sharma

unread,
Feb 29, 2012, 10:52:09 PM2/29/12
to va-sma...@googlegroups.com
Thanks John for the additional info, this is exactly what i was looking for... 

Marten Feldtmann

unread,
Mar 1, 2012, 1:29:22 AM3/1/12
to va-sma...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages