]> gitweb.factorcode.org Git - factor.git/commitdiff
Move some primitives from memory and memory.private to tools.memory.private, add...
authorSlava Pestov <slava@factorcode.org>
Mon, 5 Sep 2011 23:27:37 +0000 (16:27 -0700)
committerSlava Pestov <slava@factorcode.org>
Mon, 5 Sep 2011 23:47:29 +0000 (16:47 -0700)
basis/stack-checker/known-words/known-words.factor
basis/tools/memory/memory-docs.factor
basis/tools/memory/memory.factor
core/bootstrap/primitives.factor
core/memory/memory-docs.factor

index 22ad8d2d72c02f3a9642fbc743127e473c68c012..0ef3976e6286aa939e055c792001b04a36cf0e64 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2004, 2010 Slava Pestov, Daniel Ehrenberg.
+! Copyright (C) 2004, 2011 Slava Pestov, Daniel Ehrenberg.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: fry accessors alien alien.accessors alien.private arrays
 byte-arrays classes continuations.private effects generic
@@ -10,7 +10,7 @@ quotations.private sbufs sbufs.private sequences
 sequences.private slots.private strings strings.private system
 threads.private classes.tuple classes.tuple.private vectors
 vectors.private words words.private definitions assocs summary
-compiler.units system.private combinators
+compiler.units system.private combinators tools.memory.private
 combinators.short-circuit locals locals.backend locals.types
 combinators.private stack-checker.values generic.single
 generic.single.private alien.libraries tools.dispatch.private
@@ -348,13 +348,13 @@ M: object infer-call* \ call bad-macro-input ;
 \ callstack-for { c-ptr } { callstack } define-primitive \ callstack make-flushable
 \ callstack>array { callstack } { array } define-primitive \ callstack>array make-flushable
 \ check-datastack { array integer integer } { object } define-primitive \ check-datastack make-flushable
-\ code-room { } { byte-array } define-primitive \ code-room  make-flushable
+\ (code-room) { } { byte-array } define-primitive \ (code-room)  make-flushable
 \ compact-gc { } { } define-primitive
 \ compute-identity-hashcode { object } { } define-primitive
 \ context-object { fixnum } { object } define-primitive \ context-object make-flushable
 \ context-object-for { fixnum c-ptr } { object } define-primitive \ context-object-for make-flushable
 \ current-callback { } { fixnum } define-primitive \ current-callback make-flushable
-\ data-room { } { byte-array } define-primitive \ data-room make-flushable
+\ (data-room) { } { byte-array } define-primitive \ (data-room) make-flushable
 \ datastack { } { array } define-primitive \ datastack make-flushable
 \ datastack-for { c-ptr } { array } define-primitive \ datastack-for make-flushable
 \ die { } { } define-primitive
index b18396538f3f09c1034fb694286a6cacb4832352..61c51dbf92d5f3c228066fb3f56270b24afc29ac 100644 (file)
@@ -48,3 +48,11 @@ HELP: gc-summary.
 
 HELP: gc-events
 { $var-description "A sequence of " { $link gc-event } " instances, set by " { $link collect-gc-events } ". Can be inspected directly, or with the " { $link gc-events. } ", " { $link gc-stats. } " and " { $link gc-summary. } " words." } ;
+
+HELP: data-room
+{ $values { "data-heap-room" data-heap-room } }
+{ $description "Queries the VM for memory usage information." } ;
+
+HELP: code-room
+{ $values { "mark-sweep-sizes" mark-sweep-sizes } }
+{ $description "Queries the VM for memory usage information." } ;
index 1f1a9876b5d870c26e8c4e34da216185a0d7ffe8..04e8c47d4f011709415b9154833cdb7b5d9b1ac2 100644 (file)
@@ -1,12 +1,11 @@
-! Copyright (C) 2005, 2010 Slava Pestov.
+! Copyright (C) 2005, 2011 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs binary-search classes
 classes.struct combinators combinators.smart continuations fry
 generalizations generic grouping io io.styles kernel make math
-math.order math.parser math.statistics memory memory.private
-layouts namespaces parser prettyprint sequences
-sequences.generalizations sorting splitting strings system vm
-words hints hashtables ;
+math.order math.parser math.statistics memory layouts namespaces
+parser prettyprint sequences sequences.generalizations sorting
+splitting strings system vm words hints hashtables ;
 IN: tools.memory
 
 <PRIVATE
@@ -58,9 +57,12 @@ IN: tools.memory
 
 PRIVATE>
 
+: data-room ( -- data-heap-room )
+    (data-room) data-heap-room memory>struct ;
+
 : data-room. ( -- )
     "== Data heap ==" print nl
-    data-room data-heap-room memory>struct {
+    data-room {
         [ nursery-room. nl ]
         [ aging-room. nl ]
         [ tenured-room. nl ]
@@ -286,9 +288,12 @@ INSTANCE: code-blocks immutable-sequence
 
 PRIVATE>
 
+: code-room ( -- mark-sweep-sizes )
+    (code-room) mark-sweep-sizes memory>struct ;
+
 : code-room. ( -- )
     "== Code heap ==" print nl
-    code-room mark-sweep-sizes memory>struct mark-sweep-table. nl
+    code-room mark-sweep-table. nl
     code-blocks code-block-stats code-block-table. ;
 
 : room. ( -- )
index 7ce47a0d976e402dc711e039792b3b86be0329f2..bf2ec4defc0caf7d378902466ca087d534fc7a20 100755 (executable)
@@ -103,6 +103,7 @@ call( -- )
     "system.private"
     "threads.private"
     "tools.dispatch.private"
+    "tools.memory.private"
     "tools.profiler.private"
     "words"
     "words.private"
@@ -515,12 +516,12 @@ tuple
     { "float>bignum" "math.private" "primitive_float_to_bignum" (( x -- y )) }
     { "float>fixnum" "math.private" "primitive_float_to_fixnum" (( x -- y )) }
     { "all-instances" "memory" "primitive_all_instances" (( -- array )) }
-    { "(code-blocks)" "memory.private" "primitive_code_blocks" (( -- array )) }
-    { "code-room" "memory" "primitive_code_room" (( -- code-room )) }
+    { "(code-blocks)" "tools.memory.private" "primitive_code_blocks" (( -- array )) }
+    { "(code-room)" "tools.memory.private" "primitive_code_room" (( -- code-room )) }
     { "compact-gc" "memory" "primitive_compact_gc" (( -- )) }
-    { "data-room" "memory" "primitive_data_room" (( -- data-room )) }
-    { "disable-gc-events" "memory" "primitive_disable_gc_events" (( -- events )) }
-    { "enable-gc-events" "memory" "primitive_enable_gc_events" (( -- )) }
+    { "(data-room)" "tools.memory.private" "primitive_data_room" (( -- data-room )) }
+    { "disable-gc-events" "tools.memory.private" "primitive_disable_gc_events" (( -- events )) }
+    { "enable-gc-events" "tools.memory.private" "primitive_enable_gc_events" (( -- )) }
     { "gc" "memory" "primitive_full_gc" (( -- )) }
     { "minor-gc" "memory" "primitive_minor_gc" (( -- )) }
     { "size" "memory" "primitive_size" (( obj -- n )) }
index acf187a33ab499fde0f98a8791b555abb2693fad..29ac20a14c2589e1b80020766f47fbd23a9a013a 100644 (file)
@@ -9,14 +9,6 @@ HELP: instances
 HELP: gc ( -- )
 { $description "Performs a full garbage collection." } ;
 
-HELP: data-room ( -- data-room )
-{ $values { "data-room" data-room } }
-{ $description "Queries the VM for memory usage information." } ;
-
-HELP: code-room ( -- code-room )
-{ $values { "code-room" code-room } }
-{ $description "Queries the VM for memory usage information." } ;
-
 HELP: size ( obj -- n )
 { $values { "obj" "an object" } { "n" "a size in bytes" } }
 { $description "Outputs the size of the object in memory, in bytes. Tagged immediate objects such as fixnums and " { $link f } " will yield a size of 0." } ;