[squeak-dev] Re: A small idea how to get closer to hardware with
small efforts :)
leves at elte.hu
Mon Apr 5 20:53:12 UTC 2010
On Mon, 5 Apr 2010, Igor Stasenko wrote:
> 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
> 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