]> gitweb.factorcode.org Git - factor.git/commitdiff
vm: Add more Allocates memory comments.
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 25 Mar 2013 21:41:18 +0000 (14:41 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Tue, 26 Mar 2013 00:52:30 +0000 (17:52 -0700)
vm/allot.hpp
vm/bignum.cpp
vm/code_blocks.cpp
vm/code_heap.cpp
vm/data_heap.cpp
vm/dispatch.cpp
vm/gc.cpp
vm/vm.hpp

index 3a4e2dc2f86c422ff2c477aa9568444c226c0cf3..fb429383c85b3cda8594d2142745c57568f82ba3 100644 (file)
@@ -5,6 +5,7 @@ namespace factor
  * It is up to the caller to fill in the object's fields in a meaningful
  * fashion!
  */
+/* Allocates memory */
 inline object *factor_vm::allot_object(cell type, cell size)
 {
 #ifdef FACTOR_DEBUG
index 94026ac95ff8bcdd251a3989a8e11363cbedf088..496c6ecd64767ecfd0833c4a7a6af07d83163804 100755 (executable)
@@ -1299,6 +1299,7 @@ bignum * factor_vm::allot_bignum_zeroed(bignum_length_type length, int negative_
 }
 
 /* can allocate if not in nursery or size is larger */
+/* Allocates memory conditionally */
 #define BIGNUM_REDUCE_LENGTH(source, length)   \
 source = reallot_array(source,length + 1)
 
index 78a6f318aa5c3ac2138415a26657cc98d9442e09..2680741dd4fff37be7079b3f61b36b3371629bf6 100755 (executable)
@@ -403,6 +403,7 @@ void factor_vm::fixup_labels(array *labels, code_block *compiled)
 }
 
 /* Might GC */
+/* Allocates memory */
 code_block *factor_vm::allot_code_block(cell size, code_block_type type)
 {
        code_block *block = code->allocator->allot(size + sizeof(code_block));
@@ -431,6 +432,7 @@ code_block *factor_vm::allot_code_block(cell size, code_block_type type)
 }
 
 /* Might GC */
+/* Allocates memory */
 code_block *factor_vm::add_code_block(code_block_type type, cell code_, cell labels_,
        cell owner_, cell relocation_, cell parameters_, cell literals_,
        cell frame_size_untagged)
index 05da2936ec5a9195329359f82e61242fbfff3eba..e05c00d47495b79dcaf67b9cd87e6e1eb9954cde 100755 (executable)
@@ -189,6 +189,7 @@ void factor_vm::initialize_code_blocks()
        code->uninitialized_blocks.clear();
 }
 
+/* Allocates memory */
 void factor_vm::primitive_modify_code_heap()
 {
        bool reset_inline_caches = to_boolean(ctx->pop());
@@ -307,6 +308,7 @@ struct code_block_accumulator {
        }
 };
 
+/* Allocates memory */
 cell factor_vm::code_blocks()
 {
        code_block_accumulator accum;
@@ -314,6 +316,7 @@ cell factor_vm::code_blocks()
        return std_vector_to_array(accum.objects);
 }
 
+/* Allocates memory */
 void factor_vm::primitive_code_blocks()
 {
        ctx->push(code_blocks());
index 6fa8858f051b966690acb7ee74b009d9cd48b4f2..b3b5ed5f1c72fd3609e5a56d73cb4cc485620b89 100755 (executable)
@@ -148,6 +148,7 @@ data_heap_room factor_vm::data_room()
        return room;
 }
 
+/* Allocates memory */
 void factor_vm::primitive_data_room()
 {
        data_heap_room room = data_room();
index e8d19384cd79ab74d076b7a29d3abda21765dc19..8b2859bd7081523b598e9822b6d4d252ecdfbbd7 100755 (executable)
@@ -138,6 +138,7 @@ void factor_vm::primitive_reset_dispatch_stats()
        memset(&dispatch_stats,0,sizeof(dispatch_statistics));
 }
 
+/* Allocates memory */
 void factor_vm::primitive_dispatch_stats()
 {
        ctx->push(tag<byte_array>(byte_array_from_value(&dispatch_stats)));
index 7f79bbd725016ad465e1312dbc8a9040d1ece790..0e3d87836d1cffc8ce6c78b95a7fa1d8d458519a 100755 (executable)
--- a/vm/gc.cpp
+++ b/vm/gc.cpp
@@ -328,6 +328,7 @@ void factor_vm::primitive_enable_gc_events()
        gc_events = new std::vector<gc_event>();
 }
 
+/* Allocates memory */
 void factor_vm::primitive_disable_gc_events()
 {
        if(gc_events)
index ebc714b7f43ac7e5c8d8d30a8ce382e81b210d20..26a5dbe59bf9fb9a2f12a5a689dc518fe1c30248 100755 (executable)
--- a/vm/vm.hpp
+++ b/vm/vm.hpp
@@ -375,6 +375,7 @@ struct factor_vm
        object *allot_object(cell type, cell size);
        object *allot_large_object(cell type, cell size);
 
+       /* Allocates memory */
        template<typename Type> Type *allot(cell size)
        {
                return (Type *)allot_object(Type::type_number,size);