ObjMem.st
author Claus Gittinger <cg@exept.de>
Thu, 25 Apr 1996 18:02:18 +0200
changeset 1286 4270a0b4917d
parent 1160 1a30ffb90937
child 1288 9f6420305017
permissions -rw-r--r--
documentation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     1
"
5
67342904af11 *** empty log message ***
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1992 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 133
diff changeset
     3
	      All Rights Reserved
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
     4
a27a279701f8 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
a27a279701f8 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
a27a279701f8 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
a27a279701f8 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
a27a279701f8 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
a27a279701f8 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
a27a279701f8 Initial revision
claus
parents:
diff changeset
    11
"
a27a279701f8 Initial revision
claus
parents:
diff changeset
    12
a27a279701f8 Initial revision
claus
parents:
diff changeset
    13
Object subclass:#ObjectMemory
827
3eb3911cb63e Support of SIGCHL interrupt handling and OS-independent proces status
Stefan Vogel <sv@exept.de>
parents: 797
diff changeset
    14
	instanceVariableNames:''
3eb3911cb63e Support of SIGCHL interrupt handling and OS-independent proces status
Stefan Vogel <sv@exept.de>
parents: 797
diff changeset
    15
	classVariableNames:'InternalErrorHandler UserInterruptHandler TimerInterruptHandler
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    16
		SpyInterruptHandler StepInterruptHandler
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    17
		ExceptionInterruptHandler ErrorInterruptHandler
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    18
		MemoryInterruptHandler SignalInterruptHandler
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    19
		ChildSignalInterruptHandler DisposeInterruptHandler
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    20
		RecursionInterruptHandler IOInterruptHandler
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    21
		CustomInterruptHandler RegisteredErrorInterruptHandlers
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    22
		InterruptLatencyMonitor AllocationFailureSignal
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    23
		MallocFailureSignal LowSpaceSemaphore IncrementalGCLimit
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    24
		FreeSpaceGCLimit FreeSpaceGCAmount BackgroundCollectProcess
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
    25
		BackgroundFinalizationProcess FinalizationSemaphore Dependents
1108
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
    26
		ImageName ImageSaveTime ChangeFileName MaxInterruptLatency
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
    27
		InterruptLatencyGoal'
827
3eb3911cb63e Support of SIGCHL interrupt handling and OS-independent proces status
Stefan Vogel <sv@exept.de>
parents: 797
diff changeset
    28
	poolDictionaries:''
3eb3911cb63e Support of SIGCHL interrupt handling and OS-independent proces status
Stefan Vogel <sv@exept.de>
parents: 797
diff changeset
    29
	category:'System-Support'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
    30
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
    31
2
claus
parents: 1
diff changeset
    32
!ObjectMemory class methodsFor:'documentation'!
claus
parents: 1
diff changeset
    33
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    34
caching
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    35
"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    36
    The system uses various caches to speed up method-lookup.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    37
    Currently, there is a three-level cache hierarchy:
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    38
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    39
        inline-cache            keeps the target of the last send at the caller-
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    40
                                side (i.e. every send goes through its private 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    41
                                1-slot inline-cache, where the address of the last
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    42
                                called function at this call location is kept.)
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    43
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    44
        polymorph-inline-cache  keeps a limited list of all targets ever reached 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    45
                                at this call location. The list is automatically 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    46
                                flushed if it grows too large, or the overall number
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    47
                                of poly-chache entries exceeds a limit.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    48
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    49
        method-lookup-cache     a global cache. Hashes on class-selector pairs,
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    50
                                returning the target method.
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    51
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    52
    Whenever methods are added or removed from the system, or the inheritance 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    53
    hierarchy changes, some or all caches have to be flushed.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    54
    The flushXXX methods perform the task of flushing various caches.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    55
    All standard methods in Behavior call for cache flushing, when things change;
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    56
    however, if you use the low level access methods in Behavior
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    57
    (for example: #setSuperclass:) special care has to be taken.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    58
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    59
    In some situations, not all caches need flushing, for example a change
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    60
    in an interpreted method (currently) needs no flushing of the inline caches.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    61
    Also, flushing can be limited to entries for a specific class for most changes.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    62
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    63
    To be 'on the brigth side of live', use ObjectMemory>>flushCaches (which
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    64
    flushes all of them), when in doubt of which caches should be flushed. 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    65
    It is better flush too much - otherwise you may end up in a wrong method after 
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
    66
    a send (you wont really see a difference in speed after the flush, anyway).
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    67
"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    68
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
    69
88
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    70
copyright
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    71
"
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    72
 COPYRIGHT (c) 1992 by Claus Gittinger
159
514c749165c3 *** empty log message ***
claus
parents: 133
diff changeset
    73
	      All Rights Reserved
88
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    74
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    75
 This software is furnished under a license and may be used
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    76
 only in accordance with the terms of that license and with the
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    77
 inclusion of the above copyright notice.   This software may not
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    78
 be provided or otherwise made available to, or used by, any
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    79
 other person.  No title to or ownership of the software is
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    80
 hereby transferred.
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    81
"
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    82
!
81dacba7a63a *** empty log message ***
claus
parents: 85
diff changeset
    83
2
claus
parents: 1
diff changeset
    84
documentation
claus
parents: 1
diff changeset
    85
"
403
claus
parents: 384
diff changeset
    86
    This class contains access methods to the system memory and the VM.
claus
parents: 384
diff changeset
    87
claus
parents: 384
diff changeset
    88
    In previous ST/X versions, this stuff used to be in the Smalltalk class.
claus
parents: 384
diff changeset
    89
    It has been separated for better overall class structure and modularisation.
229
210ee6865aa3 commenting
claus
parents: 216
diff changeset
    90
    There are no instances of ObjectMemory - all is done in class methods.
403
claus
parents: 384
diff changeset
    91
    (this is a functional interface).
claus
parents: 384
diff changeset
    92
claus
parents: 384
diff changeset
    93
    Many methods here are for debuging purposes, for developers
claus
parents: 384
diff changeset
    94
    or experimental, and therefore not standard.
68
59faa75185ba *** empty log message ***
claus
parents: 56
diff changeset
    95
    Do not depend on them being there - some may vanish ...
59faa75185ba *** empty log message ***
claus
parents: 56
diff changeset
    96
    (especially those, that depend on a specific GC implementation)
403
claus
parents: 384
diff changeset
    97
    Most of the stuff found here is not available, or different or called
claus
parents: 384
diff changeset
    98
    different in other smalltalk implementations. Be aware, that using these
claus
parents: 384
diff changeset
    99
    interfaces (especially: depending on them) may make your application
claus
parents: 384
diff changeset
   100
    non portable.
claus
parents: 384
diff changeset
   101
claus
parents: 384
diff changeset
   102
    See more documentation in -> caching
1160
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   103
                              -> interrupts
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   104
                              -> garbageCollection
2
claus
parents: 1
diff changeset
   105
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
   106
    [Class variables:]
2
claus
parents: 1
diff changeset
   107
1160
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   108
        InternalErrorHandler            gets informed (by VM), when some runtime
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   109
                                        error occurs (usually fatal)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   110
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   111
        UserInterruptHandler            gets informed (by VM) when CNTL-C is pressed
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   112
        TimerInterruptHandler           gets alarm timer interrupts (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   113
        SpyInterruptHandler             another alarm timer (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   114
        StepInterruptHandler            gets single step interrupts (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   115
        ExceptionInterruptHandler       gets floating point exceptions (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   116
        ErrorInterruptHandler           gets primitive errors (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   117
        MemoryInterruptHandler          gets soon-out-of-memory conditions (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   118
        SignalInterruptHandler          gets unix signals (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   119
        ChildSignalInterruptHandler     gets child death signals (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   120
        DisposeInterruptHandler         gets informed, when an object is disposed from 
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   121
                                        a shadowArray (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   122
        RecursionInterruptHandler       gets recursion limit violations (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   123
        IOInterruptHandler              gets SIGIO unix signals (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   124
        CustomInterruptHandler          gets custom interrupts (from VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   125
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   126
        InterruptLatencyMonitor         if nonNil, that one will be notified (by the VM)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   127
                                        with an interruptLatency:millis message for every 
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   128
                                        interrupt and gets the delay time
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   129
                                        (between the time when the signal arrived and
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   130
                                         when it was really delivered) as argument.
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   131
                                        This can be used to create a statistic for
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   132
                                        realtime systems.
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   133
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   134
        RegisteredErrorInterruptHandlers
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   135
                                        associates errorID (as passed from primitive
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   136
                                        to the __errorInterruptWithID() function)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   137
                                        with handlers.
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   138
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   139
        IncrementalGCLimit              number of bytes, that must be allocated since
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   140
                                        last full garbage collect to turn the incremental
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   141
                                        collector on (at idle time).
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   142
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   143
        FreeSpaceGCLimit                low limit on freeSpace at which incremental
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   144
                                        gc starts to run at idle time.
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   145
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   146
        FreeSpaceGCAmount               amount to allocate once freeSpace drops
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   147
                                        below FreeSpaceGCLimit
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   148
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   149
        Dependents                      keep my dependents locally (its faster) for
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   150
                                        all those registries
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   151
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   152
        LowSpaceSemaphore               a semaphore signalled whenever the system is
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   153
                                        running in low memory (i.e. the memory manager
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   154
                                        ran into memory shortage and feels that it
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   155
                                        may soon no longer be able to grant allocation requests).
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   156
                                        You can have a process waiting on this semaphore
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   157
                                        which starts to remove (i.e. nil-out) objects
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   158
                                        or preform other cleanup actions.
213
3b56a17534fd *** empty log message ***
claus
parents: 211
diff changeset
   159
                                        
1160
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   160
        AllocationFailureSignal         signal raised when a new fails (see Behavior)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   161
                                        When this signal is raised, the meomory manager
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   162
                                        is really in trouble (i.e. above feelings where
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   163
                                        correct)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   164
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   165
        BackgroundCollectProcess        created by startBackgroundCollectorAt:
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   166
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   167
        BackgroundFinalizationProcess   created by startBackgroundFinalizationAt:
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   168
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   169
        ImageName                       name of the current image (or nil)
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   170
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
   171
        ImageSaveTime   <AbsoluteTime>  timestamp when this image was saved
1096
d88b93ce1194 remember image save time
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   172
d88b93ce1194 remember image save time
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
   173
403
claus
parents: 384
diff changeset
   174
    Warning:
claus
parents: 384
diff changeset
   175
      The InterruptHandler variables are known by the runtime system -
claus
parents: 384
diff changeset
   176
      they are the objects that get an interrupt message when the event
claus
parents: 384
diff changeset
   177
      occurs. You may not remove any of them.
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
   178
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
   179
    [author:]
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
   180
        Claus Gittinger
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
   181
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
   182
    [see also:]
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
   183
        ( garbage collection : html:programming/GC.html )
2
claus
parents: 1
diff changeset
   184
"
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   185
!
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   186
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   187
garbageCollection
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   188
"
403
claus
parents: 384
diff changeset
   189
    Currently, Smalltalk/X uses a two-level memory hierachy (actually, there
claus
parents: 384
diff changeset
   190
    are more memory regions used for stack, permanent objects, symbols etc.
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
   191
    but for the following discussion, these are not of interest).
403
claus
parents: 384
diff changeset
   192
claus
parents: 384
diff changeset
   193
  newSpace:
claus
parents: 384
diff changeset
   194
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   195
    Objects are created in a so-called newSpace, which is relatively small.
403
claus
parents: 384
diff changeset
   196
    This newSpace is cleaned by a so called ``scavenge''-operation, whenever 
claus
parents: 384
diff changeset
   197
    becoming full. Scavenging means, that all still-live objects (i.e. referenced
claus
parents: 384
diff changeset
   198
    by some other) are copied over to another memory area, leaving all unreachable
claus
parents: 384
diff changeset
   199
    objects as garbage behind. Thus, the newSpace actually consists of two semispaces,
claus
parents: 384
diff changeset
   200
    of whih only one is active - the other being used only while objects are
claus
parents: 384
diff changeset
   201
    copied.
claus
parents: 384
diff changeset
   202
    After this copying, these two semispaces exchange their roles - i.e. reachable
claus
parents: 384
diff changeset
   203
    objects are copied ping-pong like between these semispaces.
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   204
    Once an object survives enough of these copying operations, the next scavenge 
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   205
    will move it into the so called oldSpace, which is much larger, and not
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   206
    processed by the scavenger. 
403
claus
parents: 384
diff changeset
   207
    This movement of an object from newSpace to oldSpace is called ``tenure''.
claus
parents: 384
diff changeset
   208
    (this avoids objects being copied around forever).
claus
parents: 384
diff changeset
   209
    Once tenured, an object is no longer contained in the newSpace, and
claus
parents: 384
diff changeset
   210
    thus ceases to create any scavenging overhead after that.
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
   211
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   212
    Scavenging occurs automatically, and is usually done fast enough to go 
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   213
    unnoticed (typically, it takes some 5 to 40ms to perform a scavenge, 
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   214
    depending on how many live objects are in the newspace).
403
claus
parents: 384
diff changeset
   215
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
   216
    Interestingly, the scavenger performs better, if many garbage objects
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   217
    are to be reclaimed, since less object-copying has to be done. Therefore,
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   218
    the best-case scavenge time is almost zero, if there is only garbage in
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   219
    the newSpace. In contrast, the worst-case is when all newSpace objects are still
403
claus
parents: 384
diff changeset
   220
    living. Thus, from a newSpace collectors viewPoint, it makes sense to get
claus
parents: 384
diff changeset
   221
    objects out of the way as fast as possible. However the oldSpace is
claus
parents: 384
diff changeset
   222
    collected much less frequently and the cost to reclaim an oldspace object
claus
parents: 384
diff changeset
   223
    is much higher (actually, the cost to reclaim a newspace object is zero -
claus
parents: 384
diff changeset
   224
    its the survival of objects which we have to pay for).
claus
parents: 384
diff changeset
   225
    Therefore, from an oldSpace collectors point of view, its preferable to
claus
parents: 384
diff changeset
   226
    keep objects in the newSpace as long as possible.
claus
parents: 384
diff changeset
   227
claus
parents: 384
diff changeset
   228
    To honor this conflicting situation, the system uses an adaptive tenure-count,
207
claus
parents: 202
diff changeset
   229
    which adjusts the number of scavenges required for tenure (the so called 
claus
parents: 202
diff changeset
   230
    'tenureAge') according to the fill-grade of the newSpace.
403
claus
parents: 384
diff changeset
   231
    If the newSpace is relatively empty, it tries to keep objects longer there.
claus
parents: 384
diff changeset
   232
    The controlling parameters of the tenure age can be changed dynamically,
claus
parents: 384
diff changeset
   233
    detailed information is available upon request.
claus
parents: 384
diff changeset
   234
claus
parents: 384
diff changeset
   235
    The exact speed of the scavenger depends mostly on the speed of your memory
claus
parents: 384
diff changeset
   236
    interface (and, since most of todays memories have access times in the order
claus
parents: 384
diff changeset
   237
    of 50-100ns, the raw CPU speed does not correlate linear with the GC speed).
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   238
    Measurements give roughly 40ms for a full 400k newSpace 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   239
    (i.e. all objects survive) on a 486/50 - this only drops to some 20-30ms on a P5.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   240
403
claus
parents: 384
diff changeset
   241
    The upper bounds of the scavenge blocking time can be controlled by changing
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   242
    the size of the newSpace - either via a command line argument, or even dynamically
403
claus
parents: 384
diff changeset
   243
    by Objectmemory>>newSpaceSize:. Smaller sizes lead to shorter blocking periods,
claus
parents: 384
diff changeset
   244
    but greater absolute GC overhead. The default (400k) seems to be a good compromise.
claus
parents: 384
diff changeset
   245
    (if you are not happy with it, try playing around with the settings)
claus
parents: 384
diff changeset
   246
claus
parents: 384
diff changeset
   247
  oldSpace:
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   248
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   249
    To reclaim oldspace, the system uses three algorithms: mark&sweep, a copying
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   250
    (and compressing) baker-type collector and an incremental mark&sweep.
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   251
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   252
    The mark&sweep runs whenever the oldspace becomes full, putting dead objects
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   253
    onto a free list. If a memory request cannot be served from this freelist,
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   254
    and the total size of objects on the freelist exceeds a threshold, the system
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   255
    will compress the oldspace to make the free-space into one big area.
207
claus
parents: 202
diff changeset
   256
    This compress is done by copying all live objects into a newly allocated
claus
parents: 202
diff changeset
   257
    area, and freeing the previous memory afterwards (baker collector).
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   258
    Since a compressing oldspace collect leads to a noticable pause of the system,
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   259
    the memory manager tries hard to avoid oldspace compression.
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   260
    (well, if enough real memory is available to hold both spaces in physical
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   261
     memory, the compress is actually pretty fast).
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   262
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   263
    The incremental mark&sweep runs in the background, whenever the system is idle
403
claus
parents: 384
diff changeset
   264
    (see ProcessorSceduler>>waitForEventOrTimeout), or alternatively as a low or high
claus
parents: 384
diff changeset
   265
    priority background process (see ObjectMemory>>startBackgroundCollector). 
362
claus
parents: 360
diff changeset
   266
    Like the normal mark&sweep, this incremental collector follows object references 
claus
parents: 360
diff changeset
   267
    and marks reachable objects on its way. However, this is done 'a few objects-at-a-time',
claus
parents: 360
diff changeset
   268
    to not disrupt the system noticably. Currently, there are some (theoretical) and in
403
claus
parents: 384
diff changeset
   269
    practice never occurring situations, in which the incremental GC still creates noticable
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   270
    delays. A current project is involved with this and a future version of ST/X (ST/X-RT)
403
claus
parents: 384
diff changeset
   271
    will be available which shows deterministic worst case behavior in its GC pauses 
claus
parents: 384
diff changeset
   272
    (this will be provided as an additional add-on option - certainly not for free ;-).
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   273
403
claus
parents: 384
diff changeset
   274
    Currently, incremental GC blockings are in the order of 10-70ms.
claus
parents: 384
diff changeset
   275
    There is one catch with low priority background IGC: if there is never any idle
claus
parents: 384
diff changeset
   276
    time available (i.e. all processes run all the time), it would never get a chance
claus
parents: 384
diff changeset
   277
    to do any collection work. To handle this case, a background IGC can also be started
claus
parents: 384
diff changeset
   278
    as a high priority process, which gives up the cpu (by delaying on the time) after
claus
parents: 384
diff changeset
   279
    every IGC step. A high priority background collector will always make progress
claus
parents: 384
diff changeset
   280
    and eventually finish a GC cycle. However, it may have more of an influence on 
claus
parents: 384
diff changeset
   281
    the other processes. So, its up to you, to decide ...
362
claus
parents: 360
diff changeset
   282
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   283
362
claus
parents: 360
diff changeset
   284
    Incremental garbage collection is controlled by the variables 
claus
parents: 360
diff changeset
   285
    'IncrementalGCLimit', 'FreeSpaceGCLimit' and 'FreeSpaceGCAmount':
310
fbfb977ae1bd *** empty log message ***
claus
parents: 308
diff changeset
   286
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   287
      the ProcessorScheduler will perform incremental GC steps at idle time, 
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   288
      if the total space allocated since the last full collect exceeds 
362
claus
parents: 360
diff changeset
   289
      'IncrementalGCLimit',
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   290
      or if there are less than 'FreeSpaceGCLimit' bytes available in free store.
362
claus
parents: 360
diff changeset
   291
      If after the incrementalGC, less than 'FreeSpaceGCLimi't bytes are available,
310
fbfb977ae1bd *** empty log message ***
claus
parents: 308
diff changeset
   292
      'FreeSpaceGCAmount' more bytes are requested from the memory manager.
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   293
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   294
    The defaults are set in ObjectMemory>>initialize and can be changed in your 
403
claus
parents: 384
diff changeset
   295
    startup 'smalltalk.rc'-file. Setting them to nil turns incremental GC off.
270
f036aaa9a836 *** empty log message ***
claus
parents: 253
diff changeset
   296
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   297
362
claus
parents: 360
diff changeset
   298
    For example, setting 'IncrementalGCLimit' to 500000 will start the background collector
207
claus
parents: 202
diff changeset
   299
    whenever 500k bytes have been allocated - usually very seldom. Setting it to some
claus
parents: 202
diff changeset
   300
    small number (say 10000) will have it run very often.
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   301
362
claus
parents: 360
diff changeset
   302
    Setting 'FreeSpaceGCAmount' to (say) 1meg lets the system try to always keep
403
claus
parents: 384
diff changeset
   303
    1meg of freeSpace. If less memory is available, more oldSpace will be allocated.
claus
parents: 384
diff changeset
   304
    Keeping some memory in the pocket may prevent the system from running into a blocking
claus
parents: 384
diff changeset
   305
    GC if memory is allocated in peaks (but only, if the incremental GC can keep up with 
claus
parents: 384
diff changeset
   306
    allocation rate). The trigger level 'FreeSpaceGCLimit' should be below that amount;
310
fbfb977ae1bd *** empty log message ***
claus
parents: 308
diff changeset
   307
    to avoid excessive incremental GC activity (say 1/4 if the amount).
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   308
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   309
    Having the background GC running often should not hurt the performance of your 
362
claus
parents: 360
diff changeset
   310
    smalltalk processes, since the IGC only runs at times when no ST processes are runnable. 
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   311
    (there are some short delays in event processing, since the IGC's steps may take 
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   312
    some XX ms.) 
270
f036aaa9a836 *** empty log message ***
claus
parents: 253
diff changeset
   313
    However, if you are not alone on your machine (i.e. a timesharing system) or 
f036aaa9a836 *** empty log message ***
claus
parents: 253
diff changeset
   314
    you have other Unix processes to run, you should not run the IGC too often, 
362
claus
parents: 360
diff changeset
   315
    since it may hurt OTHER users/unix processes.
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   316
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   317
    Since this collector only runs at idle times, even a low priority background 
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   318
    process will prevent it from doing its work. You may want to start a somewhat
207
claus
parents: 202
diff changeset
   319
    higher priority background collect (say at prio 4), which also preempts these
claus
parents: 202
diff changeset
   320
    background processes. (see ObjectMemory>>startBackgroundCollectorAt:).
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   321
325
claus
parents: 324
diff changeset
   322
    Beginning with 2.10.4, a third space, called symSpace has been added.
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   323
    Objects in this space are never moved or garbage collected.
325
claus
parents: 324
diff changeset
   324
    This space is used for (some) symbols only.
claus
parents: 324
diff changeset
   325
claus
parents: 324
diff changeset
   326
    Beginning with 2.10.5, a fourth space, called fixSpace has been added.
claus
parents: 324
diff changeset
   327
    Objects in this space are never moved or garbage collected.
claus
parents: 324
diff changeset
   328
    This space is used for constant objects (true, false, some basic classes etc.).
229
210ee6865aa3 commenting
claus
parents: 216
diff changeset
   329
210ee6865aa3 commenting
claus
parents: 216
diff changeset
   330
    A plan for 2.11 is to offer an arbitrary number of spaces, which can be
210ee6865aa3 commenting
claus
parents: 216
diff changeset
   331
    attached and detached at runtime. This will allow easy share of object
210ee6865aa3 commenting
claus
parents: 216
diff changeset
   332
    with remote systems and separating objects into a per application/package
210ee6865aa3 commenting
claus
parents: 216
diff changeset
   333
    space. (be prepared for changes in the future and make your application
210ee6865aa3 commenting
claus
parents: 216
diff changeset
   334
    independ of the VM internals)
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   335
403
claus
parents: 384
diff changeset
   336
  default setup:
claus
parents: 384
diff changeset
   337
claus
parents: 384
diff changeset
   338
    The following table lists some default settings and means for changing them:
claus
parents: 384
diff changeset
   339
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   340
            what        default     change by           
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   341
                                    command line arg    dynamically
403
claus
parents: 384
diff changeset
   342
    -----------------------------------------------------------------------
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   343
        newSpace size     400k      -Mnew nnn           newSpaceSize:nnn
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   344
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   345
        oldSpace size    3000k      -Mold nnn           moreOldSpace:
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   346
                                                        announceSpaceNeed:
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   347
                                                        collectGarbage
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   348
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   349
        max tenure age     29                           lockTenure:
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   350
                                                        avoidTenure:
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   351
                                                        (sets it to infinity)
403
claus
parents: 384
diff changeset
   352
        
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   353
        adaptive tenure                                 tenureParameters
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   354
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   355
        oldSpace
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   356
        compressor      enabled     -Msingle            -
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   357
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   358
        limit for
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   359
        old-compress     8000k      -                   oldSpaceCompressLimit:
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   360
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   361
        chunk size
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   362
        to increase
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   363
        oldpPace          256k      -                   oldSpaceIncrement:
403
claus
parents: 384
diff changeset
   364
        
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   365
        prefer moreOld
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   366
        to doing GC      false      -                   fastMoreOldSpaceAllocation:
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   367
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   368
        limit for
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   369
        above                -      -                   fastMoreOldSpaceLimit:
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   370
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   371
        keep size for        -      -                   freeSpaceGCAmount:
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   372
        IGC
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   373
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   374
        low water
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   375
        trigger for IGC      -      -                   freeSpaceGCLimit:
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   376
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   377
        allocated
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   378
        trigger for IGC   500k      -                   incrementalGCLimit
403
claus
parents: 384
diff changeset
   379
claus
parents: 384
diff changeset
   380
        
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   381
    By default, no incremental GC is started by the system; however,
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   382
    the standard startup script starts a low prio background incremental GC process.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   383
    You have to edit your startup files to change this. 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   384
    A suggested configuration (used by the author and the default) is:
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   385
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   386
        ' keep 1meg in the pocket '
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   387
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   388
        ObjectMemory freeSpaceGCAmount:1000000. 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   389
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   390
        ' start incrementalGC when freespace drops below 250k '
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   391
        ' or 500k of oldSpace has been allocated              '
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   392
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   393
        ObjectMemory freeSpaceGCLimit:250000.                 '
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   394
        ObjectMemory incrementalGCLimit:500000.               '
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   395
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   396
        ' collect as a background process (the default is: at idle times)
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   397
        ' this means that running cubes or other demo processes are suspended
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   398
        ' for the collect; change the prio to below 4 if you want them to continue
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   399
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   400
        ObjectMemory startBackgroundCollectorAt:5.            '
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   401
        ObjectMemory startBackgroundFinalizationAt:5.         '
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   402
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   403
        ' quickly allocate more space (i.e. avoid blocking collects)
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   404
        ' up to 8meg - then start to collect if more memory is needed.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   405
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   406
        ObjectMemory fastMoreOldSpaceLimit:8*1024*1024.       '
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   407
        ObjectMemory fastMoreOldSpaceAllocation:true.         '
403
claus
parents: 384
diff changeset
   408
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   409
  hints & tricks:
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   410
213
3b56a17534fd *** empty log message ***
claus
parents: 211
diff changeset
   411
    normally, there is no need to call for an explicit garbage collection, or
216
a8abff749575 *** empty log message ***
claus
parents: 213
diff changeset
   412
    modify the default parameters.
213
3b56a17534fd *** empty log message ***
claus
parents: 211
diff changeset
   413
    The memory system should adapt reasonable and provide good performance 
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   414
    for a wide range of allocation patterns (see Example3 below for an exception).
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   415
207
claus
parents: 202
diff changeset
   416
    However, there may be situations, in which hints and/or explicit
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   417
    control over allocation can speedup your programs; but please:
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   418
207
claus
parents: 202
diff changeset
   419
      - if you think you have to play around with the memory policies,
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   420
        first check your program - you may find useless allocations
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   421
        or bad uses of collections. A typical error that is made is to
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   422
        create large collections using the #, (comma) concatenation method,
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   423
        which shows square behavior, since it allocates many, many temporary
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   424
        collections. Also, watch out for #copyWith:, #add: etc.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   425
        All of these create a new collection. Remember, that most collections
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   426
        offer methods to preallocate some space; for example, 'Set new:' creates
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   427
        an empty set, but preallocates space to avoid resizing over and over.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   428
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   429
        An especially bad performace dog is to use #add: on fix-size collection
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   430
        objects (such as Strings or Arrays), since in addition to allocating
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   431
        lots of garbage, a #become: operation is required for EACH element
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   432
        added. NEVER use Arrays for growing/shrinking data - use OrderedCollection
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   433
        instead. (if you really need an array, use asArray afterwards)
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   434
207
claus
parents: 202
diff changeset
   435
      - if you are going to allocate huge data structures, think about
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   436
        optimizing space. For example, if you allocate a million instances of
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   437
        some object, each added instance variable makes up 4Mb of additional 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   438
        memory need.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   439
        Also, for Byte-valued, Integer-valued and Float like objects, special
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   440
        collections are provided, which store their values directly inside (instead
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   441
        of a reference to the object). A FloatArray consisting of 1 million floats
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   442
        requires about 4mb of memory, while an Array of Floats requires 4mb for the
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   443
        references to the floats, PLUS 20Mb for the floats themself.
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   444
207
claus
parents: 202
diff changeset
   445
      - check if you really need fast access to all of these objects; you may
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   446
        try to only keep some subset in memory, and use binary storage or
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   447
        (if this is too slow) optimized store/retrieve methods and keep the bigger
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   448
        part in a file. 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   449
        (How about a DiskArray class, which does this transparently ?
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   450
         See the FileText class for some ideas and something to start with ...)
207
claus
parents: 202
diff changeset
   451
claus
parents: 202
diff changeset
   452
claus
parents: 202
diff changeset
   453
    Hint / Example 1: 
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   454
      you are about to allocate a huge data structure, which is known to
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   455
      survive long. In this case, it is better to have these objects move into the
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   456
      oldspace sooner, to avoid the copying overhead during scavenges.
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   457
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   458
      To do this, you can call ObjectMemory>>tenure after allocation, which
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   459
      forces all new-objects immediately into the oldspace. 
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   460
      Make certain, that not to many (ideally no) short-living objects are in the
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   461
      newspace when doing this.
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   462
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   463
      Another alternative is to tell the system that all allocation should be
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   464
      done directly in the oldspace. This completely avoids the scavenging overhead
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   465
      for these objects. To do so, use ObjectMemory>>turnGarbageCollectorOff
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   466
      before the allocation, and ObjectMemory>>turnGarbageCollectorOn afterwards.
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   467
      Keep in mind, that do-loops may allocate block-objects and other temporaries,
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   468
      so there is a danger of making things worse due to having all those temporaries
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   469
      in the oldspace afterwards. (which is not a fatal situation, but will
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   470
      force the system to do an oldspace collect earlier, which may not be your
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   471
      intention).
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   472
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   473
207
claus
parents: 202
diff changeset
   474
   Hint / Example 2:
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   475
      you know in advance, that a certain (big) amount of memory will be needed.
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   476
      For example, the fileBrowser wants to show a huge file in its text-view.
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
   477
      In this case, it is better to tell the memory system in advance, how much
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   478
      memory will be needed, since otherwise many compresses and reallocations will
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
   479
      occur (the memory system will allocate additional memory in chunks of smaller
433d44af1630 more GC control
claus
parents: 93
diff changeset
   480
      256k pieces, if a compress failes. Thus, if you are going to allocate (say) 1Mb of 
433d44af1630 more GC control
claus
parents: 93
diff changeset
   481
      strings, it will perform 5 compressing GC's).
433d44af1630 more GC control
claus
parents: 93
diff changeset
   482
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   483
      This is done using ObjectMemory>>moreOldSpace: or ObjectMemory announceSpaceNeed:.
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
   484
      In the above example, you would do 'ObjectMemory announceSpaceNeed:500000', which 
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
   485
      avoids those annoying 5 compressing GC's.
207
claus
parents: 202
diff changeset
   486
      BTW: if you have other smalltalk processes (threads) running which should not be
claus
parents: 202
diff changeset
   487
      paused if possible, it is better to use #announceSpaceNeed. This tries to avoid 
claus
parents: 202
diff changeset
   488
      pausing in other processes and sometimes succeeds, while moreOldSpace will always 
claus
parents: 202
diff changeset
   489
      block the whole system for a while. However, there is no 'no-pause' guarantee.
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
   490
433d44af1630 more GC control
claus
parents: 93
diff changeset
   491
      The amount of automatic increase (in case the oldSpace becomes full) is 256k by
433d44af1630 more GC control
claus
parents: 93
diff changeset
   492
      default. This number can be changed with ObjectMemory>>oldSpaceIncrement:.
433d44af1630 more GC control
claus
parents: 93
diff changeset
   493
207
claus
parents: 202
diff changeset
   494
claus
parents: 202
diff changeset
   495
    Hint / Example3:
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   496
      There are rare cases, when an explicit GC makes a difference: since
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   497
      object finalization is done at GC time, objects which keep operatingSystem
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   498
      resources may be finalized late. This is normally no problem, except if
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   499
      the system is running out of resources. For example, allocating new colors
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   500
      may fail if many colors have already been allocated in the past - even
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   501
      though these colors are actually free. The Depth8Image calls for an
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   502
      explicit GC, whenever it fails to allocate a color for a bitmap, to force
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   503
      finalization of free, but not yet finalized colors.
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   504
      The same is true for things like file descriptors, if fileStreams are not closed
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   505
      correctly.
207
claus
parents: 202
diff changeset
   506
claus
parents: 202
diff changeset
   507
    Hint 4:
claus
parents: 202
diff changeset
   508
      If you run in too small of physical memory, the incremental GC may have a
claus
parents: 202
diff changeset
   509
      bad effect on your working set: since it touches pages (which may otherwise
claus
parents: 202
diff changeset
   510
      not be needed at the moment, the operating system is forced to steal other
claus
parents: 202
diff changeset
   511
      (possibly more useful) pages from your set of incore pages.
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   512
      Although ST/X would be willing to fix this behavior (by telling the OS about
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   513
      its page requirements, many OS's do not listen. The SGI-Iris, For example ignores
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   514
      the madvice system calls - other systems do not implement it.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   515
      The trouble is that the standard LRU paging strategy is exactly the worst for
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   516
      a program which sequentially scans its memory once in a single direction ...
207
claus
parents: 202
diff changeset
   517
      You may get better performance, if you turn off the incremental GC while
claus
parents: 202
diff changeset
   518
      processing a big data structure.
claus
parents: 202
diff changeset
   519
claus
parents: 202
diff changeset
   520
229
210ee6865aa3 commenting
claus
parents: 216
diff changeset
   521
    Warning: many of the methods found here are not standard and may not even be available in
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
   522
    future versions of ST/X. Use them only in very special situations or experiments.
229
210ee6865aa3 commenting
claus
parents: 216
diff changeset
   523
207
claus
parents: 202
diff changeset
   524
    Let me know about additional special features you think are useful, and about
claus
parents: 202
diff changeset
   525
    special features you are using - this provides the feedback required to decide
403
claus
parents: 384
diff changeset
   526
    which methods are to be removed, kept or enhanced in future versions.
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
   527
"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   528
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   529
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   530
interrupts
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   531
"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   532
    Handling of interrupts (i.e. unix-signals) is done via handler objects, which
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   533
    get a #XXXInterrupt-message sent. This is more flexible than (say) signalling
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   534
    a semaphore, since the handler-object may do anything to react on the signal
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   535
    (of course, it can also signal a semaphore to emulate the above behavior).
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   536
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   537
    Another reason for having handler objects is that they allow interrupt handling
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   538
    without any context switch, for high speed interrupt response.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   539
    However, if you do this, special care is needed, since it is not defined, 
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   540
    which (smalltalk-)process gets the interrupt and will do the processing 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   541
    (therefore, the default setup installs handlers which simply signal a semaphore 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   542
     and continue the current process).
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   543
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   544
    Typically, the handlers are set during early initialization of the system
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   545
    by sending 'ObjectMemory XXXInterruptHandler:aHandler' and not changed later.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   546
    (see Smalltalk>>initialize or ProcessorScheduler>>initialize).
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   547
    To setup your own handler, create some object which responds to #xxxInterrupt,
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   548
    and make it the handler using the above method.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   549
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   550
    Interrupt messages sent to handlers are:
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   551
        internalError:<someString>      - internal interpreter/GC errors
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   552
        userInterrupt                   - ^C interrupt
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   553
        customInterrupt                 - custom interrupt
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   554
        ioInterrupt                     - SIGIO interrupt
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   555
        timerInterrupt                  - alarm timer (SIGALRM)
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   556
        errorInterrupt:<id>             - errors from other primitives/subsystems
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   557
                                          (DisplayError)
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   558
        spyInterrupt                    - spy timer interrupt (SIGVTALARM)
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   559
        stepInterrupt                   - single step interrupt
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   560
        disposeInterrupt                - finalization required
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   561
        recursionInterrupt              - recursion (stack) overflow
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   562
        memoryInterrupt                 - soon running out of memory
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   563
        fpExceptionInterrupt            - floating point exception (SIGFPE)
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   564
        childSignalInterrupt            - death of a child process (SIGCHILD)
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   565
        signalInterrupt:<number>        - unix signal (if other than above signals)
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   566
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   567
    To avoid frustration in case of badly set handlers, these messages
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   568
    are also implemented in the Object class - thus anything can be defined
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   569
    as interrupt handler. However, the VM will not send any
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   570
    interrupt message, if the corresonding handler object is nil
759
908363ce8a32 interest is written with one 'r' (shame on me)
Claus Gittinger <cg@exept.de>
parents: 703
diff changeset
   571
    (which means that nil is a bad choice, if you are interested in the event).
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   572
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   573
    Interrupt processing is not done immediately after the event arrives: 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   574
    there are certain ``save-places'' at which this handling is performed
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   575
    (message send, method return and loop-heads).
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   576
    If not explicitely enabled, primitive code is never interrupted.
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   577
    However, if you do enable interrupts in your primitive (see ExternalStream as example),
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   578
    be prepared for your objects to move around ... therefore, these have to
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   579
    be coded very carefully.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   580
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   581
    Interrupts may be disabled completely (OperatingSystem blockInterrupts) and 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   582
    reenabled (unblockInterrupts) to allow for critical data to be manipulated.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   583
    The above are low-level primitive entries - you better use #valueUninterruptably,
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   584
    which cares for unwinds, long returns and restores the blocking state.
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   585
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   586
    Every process has its own interrupt-enable state which is switched
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   587
    when processes switch control (i.e. you cannot block interrupts across
1152
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   588
    a suspend, delay etc.). 
1de5488d7c80 commentary
Claus Gittinger <cg@exept.de>
parents: 1150
diff changeset
   589
    However, the state will be restored after a resume.
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   590
"
2
claus
parents: 1
diff changeset
   591
! !
claus
parents: 1
diff changeset
   592
claus
parents: 1
diff changeset
   593
!ObjectMemory class methodsFor:'initialization'!
claus
parents: 1
diff changeset
   594
claus
parents: 1
diff changeset
   595
initialize
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   596
    "initialize the class"
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   597
2
claus
parents: 1
diff changeset
   598
    AllocationFailureSignal isNil ifTrue:[
302
1f76060d58a4 *** empty log message ***
claus
parents: 293
diff changeset
   599
	AllocationFailureSignal := ErrorSignal newSignalMayProceed:true.
159
514c749165c3 *** empty log message ***
claus
parents: 133
diff changeset
   600
	AllocationFailureSignal nameClass:self message:#allocationFailureSignal.
514c749165c3 *** empty log message ***
claus
parents: 133
diff changeset
   601
	AllocationFailureSignal notifierString:'allocation failure'.
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   602
465
fdc81f5887a1 made mallocFailureSignal a child of allocationFailureSignal
Claus Gittinger <cg@exept.de>
parents: 464
diff changeset
   603
	MallocFailureSignal := AllocationFailureSignal newSignalMayProceed:true.
464
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   604
	MallocFailureSignal nameClass:self message:#mallocFailureSignal.
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   605
	MallocFailureSignal notifierString:'(malloc) allocation failure'.
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   606
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
   607
	LowSpaceSemaphore := Semaphore new.
2
claus
parents: 1
diff changeset
   608
    ].
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
   609
    DisposeInterruptHandler := self.
2
claus
parents: 1
diff changeset
   610
    IncrementalGCLimit := 500000.
310
fbfb977ae1bd *** empty log message ***
claus
parents: 308
diff changeset
   611
    FreeSpaceGCLimit := FreeSpaceGCAmount := nil.
13
62303f84ff5f *** empty log message ***
claus
parents: 10
diff changeset
   612
    MemoryInterruptHandler := self
2
claus
parents: 1
diff changeset
   613
! !
claus
parents: 1
diff changeset
   614
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   615
!ObjectMemory class methodsFor:'ST-80 compatibility'!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   616
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   617
availableFreeBytes
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   618
    ^ self freeSpace + self freeListSpace
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   619
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   620
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   621
     ObjectMemory availableFreeBytes 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   622
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   623
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   624
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   625
bytesPerOOP
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   626
    "return the number of bytes an object reference (for example: an instvar)
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   627
     takes"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   628
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   629
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   630
    RETURN(__MKSMALLINT(sizeof(OBJ)));
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   631
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   632
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   633
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   634
     ObjectMemory bytesPerOOP 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   635
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   636
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   637
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   638
bytesPerOTE
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   639
    "return the number of overhead bytes of an object.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   640
     i.e. the number of bytes in every objects header."
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   641
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   642
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   643
    RETURN(__MKSMALLINT(OHDR_SIZE));
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   644
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   645
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   646
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   647
     ObjectMemory bytesPerOTE 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   648
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   649
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   650
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   651
compactingGC
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   652
    self garbageCollect
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   653
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   654
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   655
current
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   656
    ^ self
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   657
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   658
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   659
globalCompactingGC
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   660
    self garbageCollect
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   661
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   662
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   663
growMemoryBy:numberOfBytes
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   664
    ^ self moreOldSpace:numberOfBytes
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   665
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   666
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   667
numOopsNumBytes
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   668
    ^ Array with:(self numberOfObjects)
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   669
	    with:(self bytesUsed)
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   670
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   671
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   672
     ObjectMemory numOopsNumBytes 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   673
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   674
! !
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   675
345
claus
parents: 339
diff changeset
   676
!ObjectMemory class methodsFor:'Signal constants'!
2
claus
parents: 1
diff changeset
   677
claus
parents: 1
diff changeset
   678
allocationFailureSignal
13
62303f84ff5f *** empty log message ***
claus
parents: 10
diff changeset
   679
    "return the signal raised when an object allocation failed"
62303f84ff5f *** empty log message ***
claus
parents: 10
diff changeset
   680
2
claus
parents: 1
diff changeset
   681
    ^ AllocationFailureSignal
464
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   682
!
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   683
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   684
mallocFailureSignal
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   685
    "return the signal raised when malloc memory allocation failed.
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   686
     (usually, this kind of memory is used with I/O buffers or other temporary
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   687
      non-Object storage)"
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   688
83af924c8cff differenciate between object-allocation-failure and malloc-allocation-failure
Claus Gittinger <cg@exept.de>
parents: 458
diff changeset
   689
    ^ MallocFailureSignal
2
claus
parents: 1
diff changeset
   690
! !
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
   691
375
claus
parents: 370
diff changeset
   692
!ObjectMemory class methodsFor:'VM messages'!
claus
parents: 370
diff changeset
   693
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   694
debugPrinting
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   695
    "return true, if various debug printouts in the VM
375
claus
parents: 370
diff changeset
   696
     are turned on, false of off."
claus
parents: 370
diff changeset
   697
claus
parents: 370
diff changeset
   698
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   699
    extern int __getDebugPrinting();
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   700
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   701
    RETURN (__getDebugPrinting() ? true : false);
375
claus
parents: 370
diff changeset
   702
%}
claus
parents: 370
diff changeset
   703
!
claus
parents: 370
diff changeset
   704
claus
parents: 370
diff changeset
   705
debugPrinting:aBoolean
claus
parents: 370
diff changeset
   706
    "turn on/off various debug printouts in the VM
claus
parents: 370
diff changeset
   707
     in case of an error. For example, a double-notUnderstood
claus
parents: 370
diff changeset
   708
     leads to a VM context dump if debugPrinting is on.
claus
parents: 370
diff changeset
   709
     If off, those messages are suppressed.
claus
parents: 370
diff changeset
   710
     The default is on, since these messages are only printed for
claus
parents: 370
diff changeset
   711
     severe errors."
claus
parents: 370
diff changeset
   712
claus
parents: 370
diff changeset
   713
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   714
    __setDebugPrinting( (aBoolean == true) );
375
claus
parents: 370
diff changeset
   715
%}
claus
parents: 370
diff changeset
   716
!
claus
parents: 370
diff changeset
   717
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   718
infoPrinting
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   719
    "return true, if various informational printouts in the VM
375
claus
parents: 370
diff changeset
   720
     are turned on, false of off."
claus
parents: 370
diff changeset
   721
claus
parents: 370
diff changeset
   722
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   723
    extern int __getInfoPrinting();
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   724
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   725
    RETURN (__getInfoPrinting() ? true : false);
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   726
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   727
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   728
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   729
infoPrinting:aBoolean
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   730
    "turn on/off various informational printouts in the VM.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   731
     For example, the GC activity messages are controlled by
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   732
     this flags setting.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   733
     The default is true, since (currently) those messages
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   734
     are useful for ST/X developers."
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   735
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   736
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   737
    __setInfoPrinting( (aBoolean == true) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   738
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   739
! !
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   740
703
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   741
!ObjectMemory class methodsFor:'access debugging'!
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   742
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   743
setTrapOnAccessFor:anObject
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   744
    "install an access trap for anObject;
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   745
     An accessSignal will be raised, whenever any instvar of anObject is either read or written.
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   746
     This is not supported on all architectures, therefore the return value
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   747
     (true of trap was installed ok, false if failed) should be checked."
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   748
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   749
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   750
    RETURN (__addTrapOnAccess(anObject, 2) ? true : false);
703
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   751
%}
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   752
!
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   753
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   754
setTrapOnReadFor:anObject
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   755
    "install a read trap for anObject;
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   756
     An accessSignal will be raised, whenever any access into anObject occurrs.
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   757
     This is not supported on all architectures, therefore the return value
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   758
     (true of trap was installed ok, false if failed) should be checked."
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   759
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   760
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   761
    RETURN (__addTrapOnAccess(anObject, 0) ? true : false);
703
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   762
%}
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   763
!
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   764
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   765
setTrapOnWriteFor:anObject
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   766
    "install a write trap for anObject;
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   767
     An accessSignal will be raised, whenever any instvar of anObject is written to.
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   768
     This is not supported on all architectures, therefore the return value
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   769
     (true of trap was installed ok, false if failed) should be checked."
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   770
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   771
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   772
    RETURN (__addTrapOnAccess(anObject, 1) ? true : false);
703
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   773
%}
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   774
!
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   775
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   776
unsetAllTraps
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   777
    "remove all access traps"
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   778
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   779
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   780
    __removeAllAccessTraps();
703
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   781
%} 
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   782
!
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   783
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   784
unsetTrapFor:anObject
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   785
    "remove any access trap for anObject."
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   786
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   787
%{  /* NOCONTEXT */
829
fc386319f41c removed external function defs (soon no longer allowed)
Claus Gittinger <cg@exept.de>
parents: 827
diff changeset
   788
    __removeTrapOnAccess(anObject);
703
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   789
%}
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   790
! !
2d4202542a59 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 683
diff changeset
   791
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   792
!ObjectMemory class methodsFor:'cache management'!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   793
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   794
flushCaches
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   795
    "flush method and inline caches for all classes"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   796
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   797
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   798
    __flushMethodCache();
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   799
    __flushAllInlineCaches();
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   800
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   801
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   802
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   803
flushCachesFor:aClass
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   804
    "flush method and inline caches for aClass"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   805
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   806
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   807
    __flushMethodCacheFor(aClass);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   808
    __flushInlineCachesFor(aClass);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   809
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   810
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   811
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   812
flushCachesForSelector:aSelector
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   813
    "flush method and inline caches for aSelector"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   814
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   815
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   816
    __flushMethodCacheForSelector(aSelector);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   817
    __flushInlineCachesForSelector(aSelector);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   818
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   819
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   820
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   821
flushInlineCaches
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   822
    "flush all inlinecaches"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   823
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   824
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   825
    __flushAllInlineCaches();
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   826
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   827
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   828
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   829
flushInlineCachesFor:aClass withArgs:nargs
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   830
    "flush inlinecaches for calls to aClass with nargs arguments"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   831
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   832
%{  /* NOCONTEXT */
1133
961f2b095c22 underline cleanup
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   833
    __flushInlineCachesForAndNargs(aClass, __intVal(nargs));
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   834
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   835
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   836
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   837
flushInlineCachesForClass:aClass
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   838
    "flush inlinecaches for calls to aClass."
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   839
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   840
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   841
    __flushInlineCachesFor(aClass);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   842
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   843
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   844
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   845
flushInlineCachesForSelector:aSelector
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   846
    "flush inlinecaches for sends of aSelector"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   847
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   848
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   849
    __flushInlineCachesForSelector(aSelector);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   850
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   851
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   852
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   853
flushInlineCachesWithArgs:nargs
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   854
    "flush inlinecaches for calls with nargs arguments"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   855
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   856
%{  /* NOCONTEXT */
1133
961f2b095c22 underline cleanup
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   857
    __flushInlineCaches(__intVal(nargs));
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   858
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   859
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   860
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   861
flushMethodCache
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   862
    "flush the method cache"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   863
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   864
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   865
    __flushMethodCache();
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   866
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   867
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   868
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   869
flushMethodCacheFor:aClass
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   870
    "flush the method cache for sends to aClass"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   871
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   872
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   873
    __flushMethodCacheFor(aClass);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   874
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   875
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   876
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   877
flushMethodCacheForSelector:aSelector
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   878
    "flush the method cache for sends of aSelector"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   879
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   880
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   881
    __flushMethodCacheForSelector(aSelector);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   882
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   883
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   884
1108
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
   885
incrementSnapshotID
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
   886
%{  /* NOCONTEXT */
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
   887
    __bumpSnapshotID();
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
   888
%}
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
   889
!
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
   890
876
2fb0b80d8731 added entries to manipulate snapshotIDs
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   891
snapshotID
918
05c16023099c commentary
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   892
    "return the internal snapshotID number.
05c16023099c commentary
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   893
     This is incremented when an image is restarted, and
05c16023099c commentary
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   894
     stored with the image.
05c16023099c commentary
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   895
     Not for normal users, this is used by the VM to invalidate
05c16023099c commentary
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   896
     caches which are stored with the image"
05c16023099c commentary
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   897
876
2fb0b80d8731 added entries to manipulate snapshotIDs
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   898
%{  /* NOCONTEXT */
2fb0b80d8731 added entries to manipulate snapshotIDs
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   899
    RETURN ( __MKSMALLINT( __snapshotID() ));
2fb0b80d8731 added entries to manipulate snapshotIDs
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   900
%}
918
05c16023099c commentary
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   901
    "
05c16023099c commentary
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   902
     ObjectMemory snapshotID     
05c16023099c commentary
Claus Gittinger <cg@exept.de>
parents: 876
diff changeset
   903
    "
876
2fb0b80d8731 added entries to manipulate snapshotIDs
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   904
!
2fb0b80d8731 added entries to manipulate snapshotIDs
Claus Gittinger <cg@exept.de>
parents: 829
diff changeset
   905
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   906
trapRestrictedMethods:trap
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   907
    "Allow/Deny execution of restricted Methods (see Method>>>restricted:)
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   908
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   909
     Notice: method restriction is a nonstandard feature, not supported
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   910
     by other smalltalk implementations and not specified in the ANSI spec.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   911
     This is EXPERIMENTAL - and being evaluated for usability.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   912
     It may change or even vanish (if it shows to be not useful)."
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   913
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   914
    |oldTrap|
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   915
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   916
%{ 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   917
	if (__setTrapRestrictedMethods(trap == true))
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   918
	    oldTrap = true;
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   919
	else
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   920
	    oldTrap = false;
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   921
%}.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   922
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   923
    (trap and:[oldTrap not]) ifTrue:[
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   924
	self flushCaches
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   925
    ].
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   926
    ^ oldTrap
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   927
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   928
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   929
	ObjectMemory trapRestrictedMethods:true
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   930
	ObjectMemory trapRestrictedMethods:false
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   931
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   932
! !
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   933
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   934
!ObjectMemory class methodsFor:'debug queries'!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   935
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   936
addressOf:anObject
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   937
    "return the core address of anObject as an integer
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   938
     - since objects may move around, the returned value is invalid after the
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   939
     next scavenge/collect.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   940
     WARNING: this method is for ST/X debugging only 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   941
	      it will be removed without notice"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   942
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   943
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   944
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   945
    if (! __isNonNilObject(anObject)) {
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   946
	RETURN ( nil );
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   947
    }
646
b0a2e25461cb object addresses are unsigned (in addressOf:)
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
   948
    if ((unsigned)anObject <= _MAX_INT) {
1133
961f2b095c22 underline cleanup
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   949
	RETURN ( __MKSMALLINT((int)anObject) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   950
    }
646
b0a2e25461cb object addresses are unsigned (in addressOf:)
Claus Gittinger <cg@exept.de>
parents: 630
diff changeset
   951
    RETURN ( __MKUINT((int)anObject) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   952
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   953
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   954
    |p|
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   955
    p := Point new.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   956
    ((ObjectMemory addressOf:p) printStringRadix:16) printNL.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   957
    ObjectMemory scavenge.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   958
    ((ObjectMemory addressOf:p) printStringRadix:16) printNL.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   959
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   960
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   961
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   962
ageOf:anObject
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   963
    "return the number of scavenges, an object has survived
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   964
     in new space. 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   965
     For old objects and living contexts, the returned number is invalid.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   966
     WARNING: this method is for ST/X debugging only 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   967
	      it will be removed without notice"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   968
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   969
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   970
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   971
    if (! __isNonNilObject(anObject)) {
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   972
	RETURN ( 0 );
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   973
    }
1133
961f2b095c22 underline cleanup
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
   974
    RETURN ( __MKSMALLINT( _GET_AGE(anObject) ) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   975
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   976
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   977
    |p|
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   978
    p := Point new.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   979
    (ObjectMemory ageOf:p) printNL.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   980
    ObjectMemory tenuringScavenge.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   981
    (ObjectMemory spaceOf:p) printNL.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   982
    ObjectMemory tenuringScavenge.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   983
    (ObjectMemory spaceOf:p) printNL.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   984
    ObjectMemory tenuringScavenge.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   985
    (ObjectMemory spaceOf:p) printNL.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   986
    ObjectMemory tenuringScavenge.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   987
    (ObjectMemory spaceOf:p) printNL.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   988
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   989
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   990
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   991
dumpObject:someObject
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   992
    "low level dump an object.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   993
     WARNING: this method is for ST/X debugging only 
794
d713b6c04379 more __xx__ renames (dumpObject)
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   994
	      it may be removed (or replaced by a noop) without notice"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   995
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   996
%{
794
d713b6c04379 more __xx__ renames (dumpObject)
Claus Gittinger <cg@exept.de>
parents: 759
diff changeset
   997
    __dumpObject__(someObject);
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   998
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
   999
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1000
     ObjectMemory dumpObject:true
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1001
     ObjectMemory dumpObject:(Array new:10) 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1002
     ObjectMemory dumpObject:(10@20 corner:30@40) 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1003
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1004
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1005
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1006
flagsOf:anObject
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1007
    "For debugging only.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1008
     WARNING: this method is for ST/X debugging only 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1009
	      it will be removed without notice"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1010
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1011
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1012
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1013
    if (! __isNonNilObject(anObject)) {
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1014
	RETURN ( nil );
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1015
    }
1133
961f2b095c22 underline cleanup
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1016
    RETURN ( __MKSMALLINT( anObject->o_flags ) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1017
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1018
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1019
F_ISREMEMBERED  1       /* a new-space thing being refd by some oldSpace thing */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1020
F_ISFORWARDED   2       /* a forwarded object (you will never see this here) */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1021
F_DEREFERENCED  4       /* a collection after grow (not currently used) */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1022
F_ISONLIFOLIST  8       /* a non-lifo-context-referencing-obj already on list */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1023
F_MARK          16      /* mark bit for background collector */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1024
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1025
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1026
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1027
     |arr|
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1028
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1029
     arr := Array new.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1030
     arr at:1 put:([thisContext] value).
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1031
     (ObjectMemory flagsOf:anObject) printNL
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1032
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1033
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1034
1108
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1035
globalRefChainTo:anObject
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1036
     |levels objects setOfOwners indent|
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1037
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1038
     levels := OrderedCollection new.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1039
     objects := WeakIdentitySet with:anObject.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1040
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1041
     [objects includes:Smalltalk] whileFalse:[
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1042
         setOfOwners := WeakIdentitySet new.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1043
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1044
        objects do:[:o |
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1045
           |owners|
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1046
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1047
           owners := o allOwners.
1150
c3fddb156331 added specially tuned code for #intersects: & #contains: (for objectView performance)
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1048
           owners notNil ifTrue:[
c3fddb156331 added specially tuned code for #intersects: & #contains: (for objectView performance)
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1049
               owners := owners select:[:el | (el isMemberOf:WeakArray) not].
c3fddb156331 added specially tuned code for #intersects: & #contains: (for objectView performance)
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1050
               setOfOwners addAll:owners.
c3fddb156331 added specially tuned code for #intersects: & #contains: (for objectView performance)
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1051
           ].
1108
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1052
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1053
"/           (no instVarNamed:#keyArray) atAllPut:nil.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1054
"/           no := nil.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1055
"/           (owners instVarNamed:#keyArray) atAllPut:nil.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1056
"/           owners := nil.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1057
        ].
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1058
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1059
        levels add:objects.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1060
'done with level: ' print. levels size print. ' found ' print. objects size print. ' refs' printNL.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1061
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1062
        levels do:[:alreadyFound |
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1063
            setOfOwners remove:(alreadyFound instVarNamed:#keyArray) ifAbsent:nil.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1064
            alreadyFound do:[:o |
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1065
                setOfOwners remove:o ifAbsent:nil
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1066
            ]
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1067
        ].
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1068
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1069
        setOfOwners remove:(objects instVarNamed:#keyArray) ifAbsent:nil.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1070
"/        setOfOwners printNL.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1071
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1072
        objects := setOfOwners.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1073
        objects isEmpty ifTrue:[
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1074
"/            'none found' printNL.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1075
            ^ nil
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1076
        ].
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1077
     ].
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1078
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1079
"/     '' printNL.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1080
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1081
     ^ self 
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1082
        refChainFrom:Smalltalk
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1083
        to:anObject 
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1084
        inRefSets:levels reverse
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1085
        startingAt:1 
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1086
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1087
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1088
      self globalRefChainTo:Point new
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1089
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1090
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1091
      Smalltalk at:#foo put:Point new.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1092
      self globalRefChainTo:(Smalltalk at:#foo)
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1093
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1094
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1095
      |p|
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1096
      p := Point new.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1097
      Smalltalk at:#foo put:(#x -> p).
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1098
      self globalRefChainTo:p
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1099
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1100
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1101
      |a|
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1102
      a := Array new:1. a at:1 put:a.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1103
      Smalltalk at:#foo put:(#x -> a).
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1104
      self globalRefChainTo:a 
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1105
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1106
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1107
      |a|
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1108
      a := Array new:1. a at:1 put:a.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1109
      Smalltalk at:#foo put:(#x -> (Array with:a)).
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1110
      self globalRefChainTo:a 
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1111
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1112
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1113
      |a|
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1114
      a := Array new:1. a at:1 put:a.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1115
      Smalltalk at:#foo put:(#x -> (Array with:a with:(#y -> a))).
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1116
      self globalRefChainTo:a 
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1117
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1118
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1119
      |p|
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1120
      p := Point new.
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1121
      Smalltalk at:#foo put:(WeakArray with:(#x -> (#y -> p))).
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1122
      self globalRefChainTo:p
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1123
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1124
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1125
      self globalRefChainTo:Transcript topView
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1126
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1127
1150
c3fddb156331 added specially tuned code for #intersects: & #contains: (for objectView performance)
Claus Gittinger <cg@exept.de>
parents: 1133
diff changeset
  1128
    "Modified: 10.4.1996 / 20:15:16 / cg"
1108
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1129
!
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1130
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1131
objectAt:anAddress
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1132
    "return whatever anAddress points to as object.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1133
     BIG BIG DANGER ALERT: 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1134
	this method is only to be used for debugging ST/X itself 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1135
	- you can easily (and badly) crash the system.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1136
     WARNING: this method is for ST/X debugging only 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1137
	      it will be removed without notice"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1138
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1139
    |low high|
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1140
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1141
    low := anAddress bitAnd:16rFFFF.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1142
    high := (anAddress bitShift:16) bitAnd:16rFFFF.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1143
%{
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1144
    if (__bothSmallInteger(low, high)) {
1133
961f2b095c22 underline cleanup
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1145
	RETURN ((OBJ)((__intVal(high) << 16) | __intVal(low)));
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1146
    }
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1147
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1148
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1149
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1150
nteger(low, high)) {
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1151
	RETURN ((OBJ)((__intVal(high) << 16) | __intVal(low)));
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1152
    }
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1153
%}
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1154
!
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1155
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1156
oReferences: or anObject>>allOwners."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1157
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1158
%{
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1159
    __printRefChain(__context, anObject);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1160
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1161
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1162
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1163
to:o inRefSets:levels startingAt:1. 
1108
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1164
     "
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1165
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1166
    "Modified: 19.3.1996 / 23:22:41 / cg"
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1167
!
c6a864afd7bd refChain-debugging
Claus Gittinger <cg@exept.de>
parents: 1105
diff changeset
  1168
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1169
hist at:nw put:(hist at:nw) + 1
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1170
	 ].
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1171
     ].
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1172
     hist printNL.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1173
     big printNL
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1174
    "
375
claus
parents: 370
diff changeset
  1175
! !
claus
parents: 370
diff changeset
  1176
10
claus
parents: 5
diff changeset
  1177
!ObjectMemory class methodsFor:'dependents access'!
claus
parents: 5
diff changeset
  1178
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1179
INT( __qSpace(anObject) ) );
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1180
%}
10
claus
parents: 5
diff changeset
  1181
!
claus
parents: 5
diff changeset
  1182
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1183
ts access'!
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1184
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1185
endents:aCollection
10
claus
parents: 5
diff changeset
  1186
    "set the dependents collection"
claus
parents: 5
diff changeset
  1187
claus
parents: 5
diff changeset
  1188
    Dependents := aCollection
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1189
! !
282
94f5c3a6230d *** empty log message ***
claus
parents: 270
diff changeset
  1190
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1191
!ObjectMemory class methodsFor:'enumerating'!
282
94f5c3a6230d *** empty log message ***
claus
parents: 270
diff changeset
  1192
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1193
[
282
94f5c3a6230d *** empty log message ***
claus
parents: 270
diff changeset
  1194
		aBlock value:each
94f5c3a6230d *** empty log message ***
claus
parents: 270
diff changeset
  1195
	    ]
94f5c3a6230d *** empty log message ***
claus
parents: 270
diff changeset
  1196
	]
94f5c3a6230d *** empty log message ***
claus
parents: 270
diff changeset
  1197
    ]
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1198
!
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1199
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1200
esOfDo(&aClass, &aBlock, &work COMMA_CON) < 0) {
159
514c749165c3 *** empty log message ***
claus
parents: 133
diff changeset
  1201
	RETURN (false);
85
claus
parents: 77
diff changeset
  1202
    }
claus
parents: 77
diff changeset
  1203
%}.
claus
parents: 77
diff changeset
  1204
    ^ true
2
claus
parents: 1
diff changeset
  1205
!
claus
parents: 1
diff changeset
  1206
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1207
sOfDo((OBJ *)0, &aBlock, &work COMMA_CON) < 0) {
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1208
	RETURN (false);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1209
    }
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1210
%}.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1211
    ^ true
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1212
! !
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1213
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1214
!ObjectMemory class methodsFor:'garbage collection'!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1215
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1216
(false);
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1217
    }
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1218
%}. 
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1219
    ^ true
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1220
!
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1221
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1222
kgroundCollectProcess notNil
500
e5fd4f3c9f37 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 499
diff changeset
  1223
e5fd4f3c9f37 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 499
diff changeset
  1224
    "
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1225
     ObjectMemory backgroundCollectorRunning
375
claus
parents: 370
diff changeset
  1226
    "
claus
parents: 370
diff changeset
  1227
!
claus
parents: 370
diff changeset
  1228
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1229
AndSweep(__context);
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1230
    }
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1231
%}
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1232
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
  1233
    "
375
claus
parents: 370
diff changeset
  1234
     ObjectMemory compressingGarbageCollect
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
  1235
    "
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
  1236
!
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
  1237
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1238
t to markAndSweep
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1239
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1240
    self markAndSweep
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1241
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
  1242
    "
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1243
     ObjectMemory garbageCollect
375
claus
parents: 370
diff changeset
  1244
    "
claus
parents: 370
diff changeset
  1245
!
claus
parents: 370
diff changeset
  1246
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1247
extern int __incrGCstep();
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1248
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1249
    RETURN (__incrGCstep(__context) ? true : false);
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1250
%}
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1251
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1252
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1253
OldSpaceIfUseful
979
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
  1254
		].
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
  1255
	    ] ifFalse:[
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
  1256
		done := true
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
  1257
	    ]
Claus Gittinger <cg@exept.de>
parents: 974
diff changeset
  1258
	].
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1259
    ].
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1260
    ^ done not
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1261
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1262
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1263
ObjectMemory incrementalGC] forkAt:3
403
claus
parents: 384
diff changeset
  1264
     [ObjectMemory incrementalGC] forkAt:9 
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1265
    "
194
197c209e61f4 fine tuning tenure
claus
parents: 178
diff changeset
  1266
!
197c209e61f4 fine tuning tenure
claus
parents: 178
diff changeset
  1267
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1268
ble."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1269
%{
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1270
    __markAndSweep(__context);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1271
%}
194
197c209e61f4 fine tuning tenure
claus
parents: 178
diff changeset
  1272
197c209e61f4 fine tuning tenure
claus
parents: 178
diff changeset
  1273
    "
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1274
     ObjectMemory markAndSweep
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1275
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1276
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1277
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1278
."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1279
%{
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1280
    __reclaimSymbols(__context);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1281
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1282
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1283
     ObjectMemory reclaimSymbols
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1284
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1285
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1286
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1287
."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1288
%{
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1289
    __nonTenuringScavenge(__context);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1290
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1291
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1292
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1293
     ObjectMemory scavenge
194
197c209e61f4 fine tuning tenure
claus
parents: 178
diff changeset
  1294
    "
207
claus
parents: 202
diff changeset
  1295
!
claus
parents: 202
diff changeset
  1296
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1297
tMemory freeSpaceGCLimit:1000000.
211
58bb873aa83c *** empty log message ***
claus
parents: 207
diff changeset
  1298
     ObjectMemory startBackgroundCollectorAt:5
58bb873aa83c *** empty log message ***
claus
parents: 207
diff changeset
  1299
    "
207
claus
parents: 202
diff changeset
  1300
!
claus
parents: 202
diff changeset
  1301
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1302
oundCollectProcess := nil
207
claus
parents: 202
diff changeset
  1303
    ]
293
31df3850e98c *** empty log message ***
claus
parents: 291
diff changeset
  1304
211
58bb873aa83c *** empty log message ***
claus
parents: 207
diff changeset
  1305
    "
58bb873aa83c *** empty log message ***
claus
parents: 207
diff changeset
  1306
     ObjectMemory stopBackgroundCollector
58bb873aa83c *** empty log message ***
claus
parents: 207
diff changeset
  1307
    "
362
claus
parents: 360
diff changeset
  1308
!
claus
parents: 360
diff changeset
  1309
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1310
tMemory tenure
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1311
     ... continue - objects created above are now in oldSpace ...
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1312
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1313
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1314
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1315
ect)"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1316
%{
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1317
    __scavenge(__context);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1318
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1319
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1320
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1321
     ObjectMemory tenuringScavenge
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1322
    "
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1323
! !
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1324
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1325
!ObjectMemory class methodsFor:'garbage collector control'!
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1326
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1327
oseGarbageCollect
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1328
    "
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1329
!
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1330
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1331
eOldSpace:howMuch
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1332
	]
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1333
    ]
310
fbfb977ae1bd *** empty log message ***
claus
parents: 308
diff changeset
  1334
fbfb977ae1bd *** empty log message ***
claus
parents: 308
diff changeset
  1335
    "
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1336
     ObjectMemory announceOldSpaceNeed:1000000
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1337
    "
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1338
!
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1339
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1340
moreOldSpace:howMuch
202
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
  1341
	]
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
  1342
    ]
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
  1343
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
  1344
    "
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
  1345
     ObjectMemory announceSpaceNeed:100000
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
  1346
    "
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
  1347
!
40ca7cc6fb9c *** empty log message ***
claus
parents: 194
diff changeset
  1348
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1349
ERIMENTAL interface."
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1350
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1351
%{  /* NOCONTEXT */
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1352
    __avoidTenure(flag == true ? 1 : 0);
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1353
%}
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1354
!
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1355
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1356
!
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1357
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1358
eAllocation:true.
370
claus
parents: 369
diff changeset
  1359
     ObjectMemory fastMoreOldSpaceAllocation:prev.
claus
parents: 369
diff changeset
  1360
     ^ prev
claus
parents: 369
diff changeset
  1361
    "
claus
parents: 369
diff changeset
  1362
!
claus
parents: 369
diff changeset
  1363
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1364
aceLimit:10*1024*1024.
370
claus
parents: 369
diff changeset
  1365
     ObjectMemory fastMoreOldSpaceLimit:prev.
claus
parents: 369
diff changeset
  1366
     ^ prev
claus
parents: 369
diff changeset
  1367
    "
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1368
!
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1369
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1370
riate value"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1371
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1372
    ^ FreeSpaceGCAmount
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1373
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1374
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1375
     ObjectMemory freeSpaceGCAmount
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1376
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1377
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1378
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1379
ppropriate amount ...)
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1380
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1381
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1382
     ObjectMemory freeSpaceGCAmount:nil.     
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1383
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1384
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1385
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1386
trigger off."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1387
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1388
    ^ FreeSpaceGCLimit
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1389
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1390
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1391
     ObjectMemory freeSpaceGCLimit
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1392
    "
133
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1393
!
433d44af1630 more GC control
claus
parents: 93
diff changeset
  1394
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1395
ystem hit the wall ...)
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1396
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1397
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1398
     ObjectMemory freeSpaceGCLimit:nil.     
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1399
    "
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1400
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1401
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1402
gger off."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1403
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1404
    ^ IncrementalGCLimit
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1405
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1406
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1407
     ObjectMemory incrementalGCLimit
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1408
    "
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1409
!
85
claus
parents: 77
diff changeset
  1410
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1411
'do incr. GC very often'
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1412
     ObjectMemory incrementalGCLimit:nil.     'never'
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1413
    "
370
claus
parents: 369
diff changeset
  1414
!
claus
parents: 369
diff changeset
  1415
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1416
flag == true) {
370
claus
parents: 369
diff changeset
  1417
	__tenure(__context);
claus
parents: 369
diff changeset
  1418
    }
379
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1419
    __lockTenure(flag == true ? 1 : 0);
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1420
%}
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1421
!
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1422
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1423
if (__moveToOldSpace(anObject, __context) < 0) {
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1424
	RETURN (false);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1425
    }
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1426
%}.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1427
    ^ true
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1428
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1429
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1430
lse );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1431
    }
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1432
    RETURN (false);
379
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1433
%}
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1434
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1435
     ObjectMemory moreOldSpace:1000000
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1436
    "
379
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1437
!
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1438
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1439
ease oldSpace - reset limit' errorPrintNL.
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1440
		FreeSpaceGCLimit := nil
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1441
	    ]
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1442
	].
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1443
    ].
370
claus
parents: 369
diff changeset
  1444
!
claus
parents: 369
diff changeset
  1445
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1446
Size:200*1024
370
claus
parents: 369
diff changeset
  1447
    "
claus
parents: 369
diff changeset
  1448
claus
parents: 369
diff changeset
  1449
    " the default:
claus
parents: 369
diff changeset
  1450
claus
parents: 369
diff changeset
  1451
     ObjectMemory newSpaceSize:400*1024
claus
parents: 369
diff changeset
  1452
    "
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1453
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1454
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1455
T( __compressingGCLimit(-1) ));
1105
fe3a6359e13b added access to oldSpaceCompressLimit
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1456
%}
fe3a6359e13b added access to oldSpaceCompressLimit
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1457
    "
fe3a6359e13b added access to oldSpaceCompressLimit
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1458
     ObjectMemory oldSpaceCompressLimit
fe3a6359e13b added access to oldSpaceCompressLimit
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1459
    "
fe3a6359e13b added access to oldSpaceCompressLimit
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1460
!
fe3a6359e13b added access to oldSpaceCompressLimit
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
  1461
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1462
e the limit to 12Mb:"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1463
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1464
     ObjectMemory oldSpaceCompressLimit:12*1024*1024
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1465
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1466
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1467
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1468
LLINT( __oldSpaceIncrement(-1) )); 
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1469
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1470
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1471
     ObjectMemory oldSpaceIncrement
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1472
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1473
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1474
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1475
o change increment to 1Meg:"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1476
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1477
     ObjectMemory oldSpaceIncrement:1024*1024
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1478
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1479
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1480
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1481
e system may behave very strange."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1482
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1483
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1484
    __tenureParams(magic);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1485
%}.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1486
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1487
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1488
n by the time you read this."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1489
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1490
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1491
    __allocForceSpace(OLDSPACE);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1492
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1493
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1494
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1495
Memory>>turnGarbageCollectorOff)"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1496
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1497
%{  /* NOCONTEXT */
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1498
    __allocForceSpace(9999);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1499
%}
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1500
! !
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1501
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1502
!ObjectMemory class methodsFor:'interrupt handler access'!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1503
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1504
lag == true ? 1 : 0);
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1505
%}
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1506
!
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1507
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1508
for UNIX-death-of-a-childprocess-signal interrupts"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1509
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1510
    ^ ChildSignalInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1511
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1512
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1513
reated: 22.12.1995 / 14:14:52 / stefan"
827
3eb3911cb63e Support of SIGCHL interrupt handling and OS-independent proces status
Stefan Vogel <sv@exept.de>
parents: 797
diff changeset
  1514
    "Modified: 22.12.1995 / 14:15:16 / stefan"
3eb3911cb63e Support of SIGCHL interrupt handling and OS-independent proces status
Stefan Vogel <sv@exept.de>
parents: 797
diff changeset
  1515
!
3eb3911cb63e Support of SIGCHL interrupt handling and OS-independent proces status
Stefan Vogel <sv@exept.de>
parents: 797
diff changeset
  1516
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1517
ptHandler
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1518
    "return the handler for custom interrupts"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1519
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1520
    ^ CustomInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1521
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1522
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1523
er
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1524
    "set the handler for custom interrupts"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1525
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1526
    CustomInterruptHandler := aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1527
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1528
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1529
"return the handler for object disposal interrupts"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1530
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1531
    ^ DisposeInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1532
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1533
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1534
t the handler for object disposal interrupts"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1535
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1536
    DisposeInterruptHandler := aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1537
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1538
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1539
ler
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1540
    "return the handler for display error interrupts"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1541
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1542
    ^ ErrorInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1543
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1544
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1545
"set the handler for display error interrupts"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1546
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1547
    ErrorInterruptHandler := aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1548
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1549
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1550
the handler for floating point exception interrupts"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1551
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1552
    ^ ExceptionInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1553
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1554
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1555
c.  
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1556
     Those should not occur in normal circumstances."
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1557
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1558
    ^ InternalErrorHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1559
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1560
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1561
handler for I/O available signal interrupts (SIGIO/SIGPOLL)"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1562
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1563
    ^ IOInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1564
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1565
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1566
r I/O available signal interrupts (SIGIO/SIGPOLL)"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1567
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1568
    IOInterruptHandler := aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1569
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1570
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1571
the handler for recursion/stack overflow interrupts"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1572
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1573
    ^ RecursionInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1574
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1575
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1576
er for recursion/stack overflow interrupts"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1577
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1578
    RecursionInterruptHandler := aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1579
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1580
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1581
ctionary new
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1582
    ].
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1583
    RegisteredErrorInterruptHandlers at:errorIDSymbol put:aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1584
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1585
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1586
rruptHandlers
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1587
    "return registered handlers"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1588
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1589
    ^ RegisteredErrorInterruptHandlers
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1590
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1591
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1592
dler
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1593
    "return the handler for UNIX-signal interrupts"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1594
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1595
    ^ SignalInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1596
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1597
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1598
"set the handler for UNIX-signal interrupts"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1599
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1600
    SignalInterruptHandler := aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1601
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1602
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1603
ptHandler
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1604
    "return the handler for spy-timer interrupts"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1605
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1606
    ^ SpyInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1607
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1608
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1609
er
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1610
    "set the handler for spy-timer interrupts"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1611
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1612
    SpyInterruptHandler := aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1613
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1614
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1615
andler
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1616
    "return the handler for single step interrupts"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1617
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1618
    ^ StepInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1619
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1620
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1621
"set the handler for single step interrupts"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1622
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1623
    StepInterruptHandler := aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1624
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1625
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1626
ruptHandler
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1627
    "return the handler for timer interrupts"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1628
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1629
    ^ TimerInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1630
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1631
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1632
dler
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1633
    "set the handler for timer interrupts"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1634
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1635
    TimerInterruptHandler := aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1636
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1637
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1638
ler
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1639
    "return the handler for CNTL-C interrupt handling"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1640
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1641
    ^ UserInterruptHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1642
! !
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1643
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1644
!ObjectMemory class methodsFor:'interrupt statistics'!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1645
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1646
InterruptHandler := aHandler
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1647
!
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1648
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1649
"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1650
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1651
    "Created: 7.11.1995 / 21:05:50 / cg"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1652
    "Modified: 7.11.1995 / 21:13:33 / cg"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1653
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1654
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1655
ptLatencyMonitor := self.
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1656
    ]
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1657
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1658
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1659
     ObjectMemory interruptLatencyGoal:50
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1660
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1661
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1662
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1663
non-standard debugging/realtime instrumentation entry."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1664
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1665
    ^ InterruptLatencyMonitor
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1666
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1667
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1668
rd debugging/realtime instrumentation entry."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1669
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1670
    InterruptLatencyMonitor := aHandler
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1671
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1672
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1673
ccumulated interrupt latency in millis.
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1674
     DEMO Example."
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1675
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1676
    ^ MaxInterruptLatency
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1677
! !
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1678
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1679
!ObjectMemory class methodsFor:'low memory handling'!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1680
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1681
MaxInterruptLatency := 0
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1682
!
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1683
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1684
orPrintNL.
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1685
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1686
    LowSpaceSemaphore signalIf.
1160
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
  1687
1a30ffb90937 separated #performLowSpaceCleanup
Claus Gittinger <cg@exept.de>
parents: 1152
diff changeset
  1688
    "Modified: 12.4.1996 / 14:57:55 / cg"
362
claus
parents: 360
diff changeset
  1689
! !
claus
parents: 360
diff changeset
  1690
claus
parents: 360
diff changeset
  1691
!ObjectMemory class methodsFor:'object finalization'!
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1692
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1693
d: 12.4.1996 / 14:57:28 / cg"
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1694
!
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1695
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1696
lost a pointer recently."
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1697
%{
326
d2902942491d *** empty log message ***
claus
parents: 325
diff changeset
  1698
    __allChangedShadowObjectsDo(&aBlock COMMA_CON);
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1699
%}
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1700
!
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1701
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1702
tionSemaphore signal
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1703
    ] ifFalse:[
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1704
	"/
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1705
	"/ do it right here
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1706
	"/
291
5e036c656524 *** empty log message ***
claus
parents: 290
diff changeset
  1707
	self finalize
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1708
    ]
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1709
!
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1710
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1711
self allChangedShadowObjectsDo:[:aShadowArray | 
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1712
	aShadowArray lostPointer.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1713
    ]
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1714
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1715
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1716
inalizationProcess := p
290
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1717
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1718
    "
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1719
     ObjectMemory startBackgroundFinalizationAt:5
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1720
    "
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1721
! !
23994c0a7f7b *** empty log message ***
claus
parents: 282
diff changeset
  1722
178
4da1b10bf42c more GC control
claus
parents: 159
diff changeset
  1723
!ObjectMemory class methodsFor:'physical memory access'!
93
e31220cb391f *** empty log message ***
claus
parents: 88
diff changeset
  1724
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1725
ckgroundFinalization
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1726
    "
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1727
!
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1728
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1729
llectedOldSpacePagesDo(&aBlock COMMA_CON) < 0) {
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1730
	RETURN (false);
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1731
    }
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1732
%}.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1733
    ^ true
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1734
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1735
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1736
if (__newSpacePagesDo(&aBlock COMMA_CON) < 0) {
159
514c749165c3 *** empty log message ***
claus
parents: 133
diff changeset
  1737
	RETURN (false);
85
claus
parents: 77
diff changeset
  1738
    }
claus
parents: 77
diff changeset
  1739
%}.
claus
parents: 77
diff changeset
  1740
    ^ true
claus
parents: 77
diff changeset
  1741
!
claus
parents: 77
diff changeset
  1742
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1743
if (__oldSpacePagesDo(&aBlock COMMA_CON) < 0) {
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1744
	RETURN (false);
85
claus
parents: 77
diff changeset
  1745
    }
claus
parents: 77
diff changeset
  1746
%}.
claus
parents: 77
diff changeset
  1747
    ^ true
claus
parents: 77
diff changeset
  1748
! !
claus
parents: 77
diff changeset
  1749
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1750
!ObjectMemory class methodsFor:'queries'!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1751
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1752
supply this info - assume yes"
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1753
    ^ true
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1754
!
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1755
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1756
__newSpaceUsed() - __freeListSpace()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1757
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1758
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1759
     ObjectMemory bytesUsed  
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1760
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1761
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1762
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1763
[
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1764
	"actually this cannot happen - there is always one"
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1765
	^ nil
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1766
    ].
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1767
    ^ aCollection
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1768
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1769
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1770
TURN ( __MKSMALLINT(__fixSpaceSize()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1771
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1772
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1773
     ObjectMemory fixSpaceSize
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1774
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1775
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1776
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1777
TURN ( __MKSMALLINT(__fixSpaceUsed()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1778
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1779
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1780
     ObjectMemory fixSpaceUsed
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1781
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1782
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1783
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1784
RN ( __MKSMALLINT(__freeListSpace()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1785
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1786
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1787
     ObjectMemory freeListSpace
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1788
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1789
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1790
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1791
INT(__oldSpaceSize() - __oldSpaceUsed()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1792
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1793
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1794
     ObjectMemory freeSpace
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1795
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1796
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1797
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1798
LLINT(__garbageCollectCount()));
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1799
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1800
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1801
     ObjectMemory garbageCollectCount 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1802
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1803
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1804
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1805
SMALLINT(__incrementalGCCount()));
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1806
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1807
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1808
     ObjectMemory incrementalGCCount
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1809
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1810
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1811
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1812
EXT */
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1813
    extern int __incrGCphase();
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1814
1133
961f2b095c22 underline cleanup
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1815
    RETURN (__MKSMALLINT(__incrGCphase()));
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1816
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1817
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1818
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1819
ctMemory lastScavengeReclamation)
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1820
      / (ObjectMemory newSpaceSize)) * 100.0  
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1821
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1822
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1823
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1824
RETURN ( __lifoRememberedSet() );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1825
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1826
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1827
     ObjectMemory lifoRememberedSet
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1828
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1829
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1830
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1831
NT(__lifoRememberedSetSize()));
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1832
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1833
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1834
     ObjectMemory lifoRememberedSetSize
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1835
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1836
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1837
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1838
KSMALLINT(__markAndSweepCount()));
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1839
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1840
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1841
     ObjectMemory markAndSweepCount 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1842
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1843
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1844
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1845
HASH__ << __HASH_SHIFT__) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1846
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1847
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1848
     ObjectMemory maximumIdentityHashValue
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1849
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1850
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1851
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1852
T(__newSpaceReclaimedMin()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1853
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1854
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1855
     ObjectMemory minScavengeReclamation
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1856
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1857
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1858
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1859
TURN ( __MKSMALLINT(__newSpaceSize()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1860
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1861
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1862
     ObjectMemory newSpaceSize
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1863
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1864
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1865
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1866
N ( __MKSMALLINT(__newSpaceUsed()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1867
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1868
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1869
     ObjectMemory newSpaceUsed   
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1870
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1871
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1872
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1873
bj | tally := tally + 1].
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1874
    ^ tally
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1875
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1876
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1877
     ObjectMemory numberOfObjects  
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1878
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1879
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1880
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1881
__MKSMALLINT(__weakListSize()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1882
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1883
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1884
     ObjectMemory numberOfWeakObjects
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1885
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1886
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1887
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1888
atedSinceLastGC()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1889
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1890
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1891
     ObjectMemory oldSpaceAllocatedSinceLastGC   
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1892
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1893
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1894
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1895
TURN ( __MKSMALLINT(__oldSpaceSize()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1896
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1897
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1898
     ObjectMemory oldSpaceSize
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1899
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1900
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1901
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1902
RN ( __MKSMALLINT(__oldSpaceUsed()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1903
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1904
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1905
     ObjectMemory oldSpaceUsed  
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1906
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1907
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1908
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1909
MKSMALLINT(__rememberedSetSize()));
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1910
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1911
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1912
     ObjectMemory rememberedSetSize
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1913
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1914
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1915
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1916
jectMemory resetMinScavengeReclamation.
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1917
     ObjectMemory minScavengeReclamation
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1918
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1919
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1920
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1921
ngleOldSpace() ? true : false) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1922
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1923
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1924
     ObjectMemory runsSingleOldSpace 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1925
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1926
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1927
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1928
URN (__MKSMALLINT(__scavengeCount()));
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1929
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1930
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1931
     ObjectMemory scavengeCount 
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1932
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1933
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1934
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1935
TURN ( __MKSMALLINT(__symSpaceSize()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1936
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1937
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1938
     ObjectMemory symSpaceSize
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1939
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1940
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1941
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1942
TURN ( __MKSMALLINT(__symSpaceUsed()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1943
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1944
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1945
     ObjectMemory symSpaceUsed
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1946
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1947
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1948
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1949
*/
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1950
    extern unsigned __tenureAge();
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1951
1133
961f2b095c22 underline cleanup
Claus Gittinger <cg@exept.de>
parents: 1108
diff changeset
  1952
    RETURN ( __MKSMALLINT(__tenureAge()) );
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1953
%}
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1954
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1955
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1956
references:anObject]
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1957
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1958
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1959
     (ObjectMemory whoReferences:Transcript) printNL
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1960
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1961
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1962
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1963
:aClass]
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1964
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1965
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1966
     (ObjectMemory whoReferencesDerivedInstancesOf:View) printNL
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1967
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1968
! !
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1969
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1970
!ObjectMemory class methodsFor:'semaphore access'!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1971
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1972
sOf:SystemBrowser) printNL
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1973
    "
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1974
! !
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  1975
379
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1976
!ObjectMemory class methodsFor:'statistics'!
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1977
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1978
ease object."
379
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1979
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1980
    ^ LowSpaceSemaphore
379
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1981
! !
5b5a130ccd09 revision added
claus
parents: 375
diff changeset
  1982
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1983
!ObjectMemory class methodsFor:'system management'!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  1984
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1985
T */
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1986
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1987
    __ageStatistics();
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1988
%}
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1989
!
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1990
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1991
ay
418
claus
parents: 403
diff changeset
  1992
     change without notice."
claus
parents: 403
diff changeset
  1993
claus
parents: 403
diff changeset
  1994
%{
claus
parents: 403
diff changeset
  1995
    __REGISTRATION_DO_BLOCK(&aBlock COMMA_SND);
claus
parents: 403
diff changeset
  1996
%}
claus
parents: 403
diff changeset
  1997
!
claus
parents: 403
diff changeset
  1998
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  1999
ObjectMemory binaryModuleInfo
418
claus
parents: 403
diff changeset
  2000
    "
claus
parents: 403
diff changeset
  2001
438
claus
parents: 435
diff changeset
  2002
    "Modified: 17.9.1995 / 16:33:02 / claus"
418
claus
parents: 403
diff changeset
  2003
!
claus
parents: 403
diff changeset
  2004
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2005
ObjectMemory fullBinaryModuleInfo
418
claus
parents: 403
diff changeset
  2006
    "
claus
parents: 403
diff changeset
  2007
claus
parents: 403
diff changeset
  2008
    "Modified: 30.8.1995 / 17:29:30 / claus"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2009
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2010
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2011
nm copyWithoutLast:4
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2012
    ].
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2013
    ^ nm
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2014
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2015
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2016
     ObjectMemory imageBaseName    
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2017
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2018
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2019
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2020
not running from an image."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2021
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2022
    ^ ImageName
335
claus
parents: 332
diff changeset
  2023
claus
parents: 332
diff changeset
  2024
    "
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2025
     ObjectMemory imageName 
335
claus
parents: 332
diff changeset
  2026
    "
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2027
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2028
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2029
g image was saved.
1096
d88b93ce1194 remember image save time
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2030
     Return nil if not running from an image."
d88b93ce1194 remember image save time
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2031
d88b93ce1194 remember image save time
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2032
    ^ ImageSaveTime
d88b93ce1194 remember image save time
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2033
!
d88b93ce1194 remember image save time
Claus Gittinger <cg@exept.de>
parents: 984
diff changeset
  2034
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2035
tNil and:[newClass implements:#initialize]) ifTrue:[
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2036
	    newClass initialize
159
514c749165c3 *** empty log message ***
claus
parents: 133
diff changeset
  2037
	]
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2038
    ]
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2039
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2040
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2041
"/    ^ self imageBaseName , '.chg'
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2042
335
claus
parents: 332
diff changeset
  2043
    "
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2044
     ObjectMemory nameForChanges    
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2045
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2046
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2047
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2048
ngeFileName := aFilename
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2049
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2050
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2051
     ObjectMemory nameForChanges:'myChanges'    
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2052
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2053
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2054
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2055
^ self imageBaseName , '.img'
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2056
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2057
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2058
     ObjectMemory nameForSnapshot    
335
claus
parents: 332
diff changeset
  2059
    "
1
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2060
!
a27a279701f8 Initial revision
claus
parents:
diff changeset
  2061
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2062
"
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2063
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2064
    ^ self imageBaseName , '.src'
362
claus
parents: 360
diff changeset
  2065
claus
parents: 360
diff changeset
  2066
    "
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2067
     ObjectMemory nameForSources    
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2068
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2069
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2070
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2071
n(__context, _stringVal(aFileName), funny);
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2072
	__UNBLOCKINTERRUPTS();
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2073
    }
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2074
%}.
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2075
    ^ ok
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2076
!
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2077
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2078
."
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2079
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2080
    self snapShotOn:(self nameForSnapshot)
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2081
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2082
    "
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2083
     ObjectMemory snapShot
362
claus
parents: 360
diff changeset
  2084
    "
claus
parents: 360
diff changeset
  2085
! !
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2086
630
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 615
diff changeset
  2087
!ObjectMemory class methodsFor:'documentation'!
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 615
diff changeset
  2088
1286
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2089
mory snapShotOn:'myimage.img'
4270a0b4917d documentation
Claus Gittinger <cg@exept.de>
parents: 1160
diff changeset
  2090
    "
630
b785d23d7c5b version at the end
Claus Gittinger <cg@exept.de>
parents: 615
diff changeset
  2091
! !
615
e9d0e782206d checkin from browser
Claus Gittinger <cg@exept.de>
parents: 532
diff changeset
  2092
ObjectMemory initialize!