From: | James L Boyd |
Date: | 14 Mar 2001 at 02:47:05 |
Subject: | Re: Close P61 Library...? |
> free from my compiled file! There are some CLI commands arround
like
> "VTFlush3" to flash not needed libs in memory! How can i close and
free
> this with my own code in my program? CloseLibrary_ doenst work !? ;(
OK, this is a small CLI util that flushes a named library (note you can
alter it for devices and other things). Below that is a program that does
the same as Avail Flush, which should free unused libs, devices, fonts, etc,
but see the warning given.
---------
; Flush specific library. easily adapted for devices, tasks (!),
; ports, etc.
; No way to check it's worked or not unless you check through 'em
; all again...RemLibrary, etc don't return values.
a$=Peek.s(GetArgStr_()) ; from CLI
a$=Left$(a$,Peek.l(&a$-4)-1) ; strip newline or whatever
; comment out above two lines and make a$="xxxxx.library" if you
; want to try it from here...
If a$
*exec.ExecBase=Peek.l(4)
*mylist.List=*exec\LibList ; replace LibList with DeviceList, etc...
Forbid_
*libnode.Node=FindName_ (*mylist,&a$)
If *libnode
RemLibrary_ *libnode ; replace RemLibrary with RemDevice, etc.
EndIf
Permit_
EndIf
End
-------------
The Avail Flush equivalent:
--------------
For a=1 To 10
AllocMem_ $7ffffff0,#MEMF_PUBLIC ; flush ten times :
Next a ; this is how "avail
; flush" does it...
---------------
The only problem with that last one is that if certain programs are running,
they'll crash (especially Internet MUI apps for some reason) -- but they do
the same with Avail Flush!
See ya,
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list/-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list/-help@netsoc.ucd.ie