FFI Question on Linux

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Mon Oct 23 11:33:06 UTC 2000


On Mon, 23 Oct 2000, Henrik Gedenryd wrote:

> I realized that listing all modules that are available for loading
> cannot really be done.

Well - the attached method, "Smalltalk listReferencedModules", gives
all module names that are refered to in the image. You could try loading
each one in turn to see whether it is available ... Left as an exercise to
the reader ;)

-- Bert
-------------- next part --------------
'From Squeak2.9alpha of 13 June 2000 [latest update: #2774] on 23 October 2000 at 1:28:43 pm'!

!SystemDictionary methodsFor: 'miscellaneous' stamp: 'bf 10/23/2000 13:26'!
listReferencedModules
	"Smalltalk listReferencedModules"
	"Return a list of all referenced modules (e.g., plugins). Referenced modules are those that are refered to as named primitive in a CompiledMethod."
	| modules m module |
	modules _ Set new: 42.
	self allBehaviorsDo: 
		[:class | class selectorsDo: 
			[:sel | m _ class compiledMethodAt: sel.
				(m primitive == 117 and: [(module _ m literals first first) notNil])
					ifTrue: [modules add: module asString]]].
	^ modules
! !


More information about the Squeak-dev mailing list