ObjectMemory.st
changeset 2320 a6f75a38159f
parent 2262 4c4d810f006f
child 2337 f3d67c64da4d
equal deleted inserted replaced
2319:640bb389f90a 2320:a6f75a38159f
   638 ! !
   638 ! !
   639 
   639 
   640 !ObjectMemory class methodsFor:'ST-80 compatibility'!
   640 !ObjectMemory class methodsFor:'ST-80 compatibility'!
   641 
   641 
   642 availableFreeBytes
   642 availableFreeBytes
       
   643     "return the amount of free memory
       
   644      (both in the compact free area and in the free lists)"
       
   645 
   643     ^ self freeSpace + self freeListSpace
   646     ^ self freeSpace + self freeListSpace
   644 
   647 
   645     "
   648     "
   646      ObjectMemory availableFreeBytes 
   649      ObjectMemory availableFreeBytes 
   647     "
   650     "
       
   651 
       
   652     "Modified: 29.1.1997 / 23:43:05 / cg"
   648 !
   653 !
   649 
   654 
   650 bytesPerOOP
   655 bytesPerOOP
   651     "return the number of bytes an object reference (for example: an instvar)
   656     "return the number of bytes an object reference (for example: an instvar)
   652      takes"
   657      takes"
   672      ObjectMemory bytesPerOTE 
   677      ObjectMemory bytesPerOTE 
   673     "
   678     "
   674 !
   679 !
   675 
   680 
   676 compactingGC
   681 compactingGC
       
   682     "perform a compacting garbage collect"
       
   683 
   677     self garbageCollect
   684     self garbageCollect
       
   685 
       
   686     "Modified: 29.1.1997 / 23:43:25 / cg"
   678 !
   687 !
   679 
   688 
   680 current
   689 current
       
   690     "the 'current' ObjectMemory - thats myself"
       
   691 
   681     ^ self
   692     ^ self
       
   693 
       
   694     "Modified: 29.1.1997 / 23:43:39 / cg"
   682 !
   695 !
   683 
   696 
   684 globalCompactingGC
   697 globalCompactingGC
       
   698     "perform a compacting garbage collect"
       
   699 
   685     self garbageCollect
   700     self garbageCollect
       
   701 
       
   702     "Modified: 29.1.1997 / 23:43:47 / cg"
   686 !
   703 !
   687 
   704 
   688 growMemoryBy:numberOfBytes
   705 growMemoryBy:numberOfBytes
       
   706     "allocate more memory"
       
   707 
   689     ^ self moreOldSpace:numberOfBytes
   708     ^ self moreOldSpace:numberOfBytes
       
   709 
       
   710     "Modified: 29.1.1997 / 23:44:01 / cg"
   690 !
   711 !
   691 
   712 
   692 numOopsNumBytes
   713 numOopsNumBytes
       
   714     "return an array filled with the number of objects
       
   715      and the number of used bytes."
       
   716 
   693     ^ Array with:(self numberOfObjects)
   717     ^ Array with:(self numberOfObjects)
   694 	    with:(self bytesUsed)
   718             with:(self bytesUsed)
   695 
   719 
   696     "
   720     "
   697      ObjectMemory numOopsNumBytes 
   721      ObjectMemory numOopsNumBytes 
   698     "
   722     "
       
   723 
       
   724     "Modified: 29.1.1997 / 23:44:24 / cg"
   699 ! !
   725 ! !
   700 
   726 
   701 !ObjectMemory class methodsFor:'Signal constants'!
   727 !ObjectMemory class methodsFor:'Signal constants'!
   702 
   728 
   703 allocationFailureSignal
   729 allocationFailureSignal
  3981 ! !
  4007 ! !
  3982 
  4008 
  3983 !ObjectMemory class methodsFor:'documentation'!
  4009 !ObjectMemory class methodsFor:'documentation'!
  3984 
  4010 
  3985 version
  4011 version
  3986     ^ '$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.134 1997-01-24 22:10:08 cg Exp $'
  4012     ^ '$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.135 1997-01-29 22:44:54 cg Exp $'
  3987 ! !
  4013 ! !
  3988 ObjectMemory initialize!
  4014 ObjectMemory initialize!