private.rc
author Claus Gittinger <cg@exept.de>
Fri, 19 Jul 1996 11:27:20 +0200
changeset 126 565643e43074
parent 123 a974136fe017
child 141 bf500c06ebdc
permissions -rw-r--r--
*** empty log message ***

"*
 * $Header$
 *
 * sample private.rc - file
 *
 * a copy of this file can (should) reside in $home/.smalltalk/private.rc or
 * in the current directory - put all private preferences in here.
 *
 *
 * notice, you will find some things enclosed in
 *  ... getLoginName = 'claus' ifTrue:[
 *      
 * these are my personal preferrences which will be
 * ignored in your environment, but are taken in mine.
 * That way, I dont have to maintain two different 'private.rc' files.
 * (you may want to have a look into it - some is of general interrest)
 *"

"/
"/ I want the hostname to be prepended to a windows label
"/
StandardSystemView includeHostNameInLabel:true.

"/
"/ this turns off error/fatal messages from the VM
"/ (it does not really make sense to turn them off)
"/
"/ Smalltalk debugPrinting:false.

"/
"/ set the package for fileIns done below
"/
Project notNil ifTrue:[
    Project setDefaultProject.
    Project current packageName:#'goody-fileIn'.
].
!

|whoAmI|

'reading keyboard.rc ...' infoPrintCR.
Smalltalk fileIn:'keyboard.rc'.

"/
"/ no matter what the 'display.rc' says:
"/     I want my #iris style ...
"/
View defaultStyle:#iris.
"/ View defaultStyle:#motif.



"/ add my private directories to the searchPath ...
"/ This does not make sense in your environment.
"/ However, I leave the code here to show how its done.
"/
Smalltalk systemPath addFirst:'../..'.

whoAmI := OperatingSystem getLoginName.

(whoAmI = 'claus' or:[whoAmI = 'cg']) ifTrue:[
    Smalltalk systemPath addFirst:'../../not_delivered'.
    Smalltalk systemPath addFirst:'../../private_classes'.
    Smalltalk systemPath addFirst:'../../fileIn/not_delivered'.
    Smalltalk systemPath addFirst:'../../libpro'.
].

"/ since smalltalk keeps track of which directories exist
"/ in the path, this cache has to be flushed whenever new directories
"/ are added to the path:
"/
Smalltalk flushPathCaches.

"/
"/ color allocation strategy:
"/
"/ the default is to allocate from the colormap as required.
"/ As long as the number of distinct colors used is less than the number
"/ of available colors (which is usually the case) this leads to better looking
"/ images.
"/ However, if many images are to be displayed simulatiously, images displayed
"/ first may steal too many colors required in images displayed later.
"/ In this case, it is better to preallocate some colors, and dither all images
"/ using theese. Of course, while making the worst case better, this makes
"/ the best case worse. You can decide ...
"/
"/   Color getColors6x6x4.


"/ The following loads some nice cursors; for example thumbsUp and thumbsDown
"/
"/ claus:
"/     I like those fancy cursors :-)
"/     if you think this is too 'childish', remove the line below ...
"/
"/
"/ 'loading fancy cursors ...' infoPrintCR.
Cursor initializeNewCursors.


"/ claus:
"/     The history manager automatically adds a history line to changed
"/     methods and optionally to a classes history method.
"/
(whoAmI = 'claus' or:[whoAmI = 'cg']) ifTrue:[
    Compiler warnSTXSpecials:false.
    HistoryManager notNil ifTrue:[
	'activating HistoryManager ...' infoPrintCR.
	HistoryManager activate.
    ]
].

"/ claus:
"/     I dont want those warnings about stx features being non-portable ...
"/     However, you should (at least when new to the system) see them.
"/     Once you get bored about them, make the below unconditional.
"/     (you can also turn them off in the NewLaunchers settings menu ...)
"/
Compiler allowUnderscoreInIdentifier:true. 
Compiler warnUnderscoreInIdentifier:false. 


"/ this is a temporary kludge: specify the flags to be used
"/ when compiling via stc. Primitive compilation (from within the browser)
"/ is still experimental. So you better not care (yet)
"/ BTW: its only supported on UnixWare and SGI anyway 
"/      (and not in the free demo release).
"/
Compiler stcCompilation:#default.
OperatingSystem getOSType = 'irix' ifTrue:[
    Compiler stcCompilationIncludes:'-I../../include -I../../libPVM/pvm3/include -I../../libPVM/pvm3/pvmgs'.
    Compiler stcCompilationDefines:'-DGLX'.
] ifFalse:[
    Compiler stcCompilationIncludes:'-I../../include -I../../support/VGL/vogl/src -I../../libPVM/pvm3/include -I../../libPVM/pvm3/pvmgs'.
    Compiler stcCompilationDefines:'-DVGL'.

"/
"/ disabled; thats the default anyway ....
"/
"/    OperatingSystem getOSType = 'linux' ifTrue:[
"/      ObjectFileLoader searchedLibraries:#('/usr/lib/libc.a')
"/    ]

].
Compiler stcCompilationOptions:'+optinline +inlineNew -O'.

"/ experimental: try to always keep some bytes in the pocket
"/ this changes the memory policy, to start the background collector whenever
"/ freespace drops below 250k or 500k have been allocated since the last GC. 
"/ AND to allocate more memory, if (after the collect) less than 1Mb is free.
"/ Doing so makes the system behave better if lots of memory is required
"/ for short periods of time, since it prepares itself for that situation
"/ during idle time. (I often walk around in the fileBrowser, loading big
"/ files like XWorkstation.st or SystemBrowser.st ....)
"/
ObjectMemory freeSpaceGCAmount:1000000. 
ObjectMemory freeSpaceGCLimit:250000. 
ObjectMemory incrementalGCLimit:500000. 
ObjectMemory startBackgroundCollectorAt:5. 
ObjectMemory startBackgroundFinalizationAt:5. 

"/ experimental: configure the memory manager to quickly increase
"/ its oldSpace, as long as it stays below 8Mb (i.e. do not enter
"/ a blocking mark&sweep or compress, but go straight ahead increasing
"/ the oldSpace). Above that, behave as usual, i.e. try a GC first,
"/ then increase the oldSpace size if that did not help.
"/ If you have a machine with lots of (real) memory, you may want to
"/ increase the number. The value below should be ok for 16-32Mb machines.
"/
ObjectMemory fastMoreOldSpaceLimit:8*1024*1024.
ObjectMemory fastMoreOldSpaceAllocation:true.
!

"/ another experimental (and a secret for now, since I dont want
"/ you to play with those ;-)
"/ For now, this is experimental. Once the best numbers
"/ have been found, I'll hardwire them and document it ...

|a|
ObjectMemory newSpaceSize > (500*1024) ifTrue:[
    a := #(nil nil nil nil -16 -4 -2 -2 0 0 16 nil) copy.
] ifFalse:[
"/         min max cpy /32 /16 /8 /4 /2 /4 /8 /16 /32 "
    "/
    "/ slow tenure - keeps objects longer in newSpace,
    "/  producing more scavenge overhead, but releasing IGC somewhat
    "/
"/  a := #(nil nil nil -100 -8 -4 -1  1 2  4  8   16 nil) copy.
"/  a := #(nil nil nil nil -16 -4  0  0  0 4 16 nil) copy.

    "fast tenure"
    "/
    "/ fast tenure - moves objects earlier into oldSpace,
    "/ releasing newSpace collector; however, the oldSpace IGC
    "/ may have more work to do.
    "/
    a := #(nil nil nil nil -20 -8 -3 -1 -1 1 16 nil) copy.
].
ObjectMemory tenureParameters:a.


"/ set the package back to some useful default for programming
"/ this is the package token assigned (by default) to all new methods/classes
"/ (so you can use a browser on package=#private to find all of your new
"/ stuff easily. (the conditional on Project being nonNil is for stripped down
"/ systems without a Project class)

Project notNil ifTrue:[
    Project setDefaultProject.
    Project current packageName:#'private'.
].
!

(Smalltalk commandLine includes:'-q') ifFalse:[
    "/
    "/ this turns off/on information messages from classes
    "/ (such as 'D8IMAGE: allocating colors ...'
    "/
    "/ Object infoPrinting:false.
    Object infoPrinting:true.

    "/
    "/ this turns off/on information messages from the VM
    "/ (such as 'MEM: chitty chatty ...'
    "/
    "/ ObjectMemory infoPrinting:false.
    ObjectMemory infoPrinting:true.
].
!