[squeak-dev] Re: A small idea how to get closer to hardware with small efforts :)

Igor Stasenko siguctua at gmail.com
Mon Apr 5 20:29:44 UTC 2010

On 5 April 2010 23:15, Casey Ransberger <casey.obrien.r at gmail.com> wrote:
> I would think it was great, as long as I could do something like
> Smalltalk hasNativeCode
> To check if there's any of it in the image, and
> Smalltalk purgeNativeCode
> (e.g., before a release of the image)
> I definitely don't think we should ship any native code in the image in
> releases...
this is pretty straightforward:

nativeMethods := CompiledMethod allInstances collect: [:m | m trailer
nativeCode notNil ].
purgedMethods := Array new: nativeMethods size.
1 to: nativeMethods size do: [:i |
  purgedMethods at: i put:  (( nativeMethods at:i)
copyWithTrailerBytes: CompiledMethodTrailer empty) ].

nativeMethods elementsExchangeIdentityWith: purgedMethods.

Best regards,
Igor Stasenko AKA sig.

More information about the Squeak-dev mailing list