]> gitweb.factorcode.org Git - factor.git/commitdiff
VM: Refactor allot.hpp to Factor style
authorErik Charlebois <erikcharlebois@gmail.com>
Sun, 12 May 2013 02:32:45 +0000 (22:32 -0400)
committerErik Charlebois <erikcharlebois@gmail.com>
Sun, 12 May 2013 17:24:40 +0000 (13:24 -0400)
vm/allot.hpp

index fb429383c85b3cda8594d2142745c57568f82ba3..cc45535adff2b5ab78c6af3a413fbd5c60dbe3e0 100644 (file)
@@ -1,34 +1,30 @@
-namespace factor
-{
+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)
-{
+inline object* factor_vm::allot_object(cell type, cell size) {
 #ifdef FACTOR_DEBUG
-       FACTOR_ASSERT(!current_gc);
+  FACTOR_ASSERT(!current_gc);
 #endif
 
-       /* If the object is smaller than the nursery, allocate it in the nursery,
-       after a GC if needed */
-       if(nursery.size > size)
-       {
-               /* If there is insufficient room, collect the nursery */
-               if(nursery.here + size > nursery.end)
-                       primitive_minor_gc();
+  /* If the object is smaller than the nursery, allocate it in the nursery,
+     after a GC if needed */
+  if (nursery.size > size) {
+    /* If there is insufficient room, collect the nursery */
+    if (nursery.here + size > nursery.end)
+      primitive_minor_gc();
 
-               object *obj = nursery.allot(size);
+    object* obj = nursery.allot(size);
 
-               obj->initialize(type);
-               return obj;
-       }
-       /* If the object is bigger than the nursery, allocate it in
-       tenured space */
-       else
-               return allot_large_object(type,size);
+    obj->initialize(type);
+    return obj;
+  } /* If the object is bigger than the nursery, allocate it in
+       tenured space */
+  else
+    return allot_large_object(type, size);
 }
 
 }