]> gitweb.factorcode.org Git - factor.git/commitdiff
basic shadowed name changes
authorRazetime <rraghu.11502@gmail.com>
Sun, 12 Feb 2023 15:39:05 +0000 (21:09 +0530)
committerRazetime <rraghu.11502@gmail.com>
Sun, 12 Feb 2023 15:39:05 +0000 (21:09 +0530)
.gitignore
Nmakefile
vm/aging_space.hpp
vm/allot.hpp
vm/bump_allocator.hpp
vm/mark_bits.hpp
vm/tenured_space.hpp

index a4d2fe8ceea5b4141b32f6237786124f36431f78..c89b3eaba889a00ef3ff7aa02a8e856e6aa7b039 100644 (file)
@@ -23,6 +23,7 @@
 .*.swp
 .DS_Store
 .gdb_history
+.vs
 /factor
 /logs
 /work
index 065d24a757cc00a5710bf97b574b96c2e45e9b48..d92e5ee2d1fd6b0d791e1dffedf97c283e16c4c6 100644 (file)
--- a/Nmakefile
+++ b/Nmakefile
@@ -127,7 +127,7 @@ DLL_OBJS = $(PLAF_DLL_OBJS) \
 
 # batch mode has ::
 .cpp.obj::
-       cl /EHsc $(CL_FLAGS) /MP /Fovm/ /c $<
+       cl /EHsc $(CL_FLAGS) /W4 /MP /Fovm/ /c $<
 
 .c.obj::
        cl /EHsc $(CL_FLAGS) /MP /Fovm/ /c $<
index fc6c150d62054820fcc19d1b680d6087a89e16d8..89c2f797fd8771bc147ad4068b0c74673a483742 100644 (file)
@@ -6,19 +6,19 @@ struct aging_space : bump_allocator {
   aging_space(cell size, cell start)
       : bump_allocator(size, start), starts(size, start) {}
 
-  object* allot(cell size) {
-    if (here + size > end)
+  object* allot(cell dsize) {
+    if (here + dsize > end)
       return NULL;
 
-    object* obj = bump_allocator::allot(size);
+    object* obj = bump_allocator::allot(dsize);
     starts.record_object_start_offset(obj);
     return obj;
   }
 
   cell next_object_after(cell scan) {
-    cell size = ((object*)scan)->size();
-    if (scan + size < here)
-      return scan + size;
+    cell dsize = ((object*)scan)->size();
+    if (scan + dsize < here)
+      return scan + dsize;
     return 0;
   }
 
index 1987b2b0e4f463f8b35350406541bad4b941ff8f..446f36b2db8a724f740f3c75c53bbf50b697a356 100644 (file)
@@ -64,18 +64,18 @@ inline object* factor_vm::allot_large_object(cell type, cell size) {
 inline object* factor_vm::allot_object(cell type, cell size) {
   FACTOR_ASSERT(!current_gc);
 
-  bump_allocator *nursery = data->nursery;
+  bump_allocator *dnursery = data->nursery;
 
   // If the object is bigger than the nursery, allocate it in tenured space
-  if (size >= nursery->size)
+  if (size >= dnursery->size)
     return allot_large_object(type, size);
 
   // If the object is smaller than the nursery, allocate it in the nursery,
   // after a GC if needed
-  if (nursery->here + size > nursery->end)
+  if (dnursery->here + size > dnursery->end)
     primitive_minor_gc();
 
-  object* obj = nursery->allot(size);
+  object* obj = dnursery->allot(size);
   obj->initialize(type);
 
   return obj;
index 28aa527fd49104f8faff3f0bcb7bccc84ab9fabd..aeb9638762f25623530047b1c38ead68894fd1c3 100644 (file)
@@ -14,9 +14,9 @@ struct bump_allocator {
     return (cell)obj >= start && (cell)obj < end;
   }
 
-  object* allot(cell size) {
+  object* allot(cell dsize) {
     cell h = here;
-    here = h + align(size, data_alignment);
+    here = h + align(dsize, data_alignment);
     return (object*)h;
   }
 
index efd66b339c34f0fc5811cc233f015ffdcb7f25fc..e7600e2417393f96f07ac06f33572c2ff1b7ce8e 100644 (file)
@@ -51,20 +51,20 @@ struct mark_bits {
     return (bits[position.first] & ((cell)1 << position.second)) != 0;
   }
 
-  void set_bitmap_range(cell* bits, const cell address, const cell size) {
-    std::pair<cell, cell> start = bitmap_deref(address);
-    std::pair<cell, cell> end = bitmap_deref(address + size);
+  void set_bitmap_range(cell* bits, const cell address, const cell dsize) {
+    std::pair<cell, cell> bstart = bitmap_deref(address);
+    std::pair<cell, cell> end = bitmap_deref(address + dsize);
 
-    cell start_mask = ((cell)1 << start.second) - 1;
+    cell start_mask = ((cell)1 << bstart.second) - 1;
     cell end_mask = ((cell)1 << end.second) - 1;
 
-    if (start.first == end.first)
-      bits[start.first] |= start_mask ^ end_mask;
+    if (bstart.first == end.first)
+      bits[bstart.first] |= start_mask ^ end_mask;
     else {
-      FACTOR_ASSERT(start.first < bits_size);
-      bits[start.first] |= ~start_mask;
+      FACTOR_ASSERT(bstart.first < bits_size);
+      bits[bstart.first] |= ~start_mask;
 
-      for (cell index = start.first + 1; index < end.first; index++)
+      for (cell index = bstart.first + 1; index < end.first; index++)
         bits[index] = (cell)-1;
 
       if (end_mask != 0) {
@@ -76,8 +76,8 @@ struct mark_bits {
 
   bool marked_p(const cell address) { return bitmap_elt(marked, address); }
 
-  void set_marked_p(const cell address, const cell size) {
-    set_bitmap_range(marked, address, size);
+  void set_marked_p(const cell address, const cell dsize) {
+    set_bitmap_range(marked, address, dsize);
   }
 
   // The eventual destination of a block after compaction is just the number
index 2fff0515ad7cd6e43e18d583d42270413aea6ef2..739ba903908db462eec9ffe621b5426e2c88743d 100644 (file)
@@ -6,8 +6,8 @@ struct tenured_space : free_list_allocator<object> {
   tenured_space(cell size, cell start)
       : free_list_allocator<object>(size, start), starts(size, start) {}
 
-  object* allot(cell size) {
-    object* obj = free_list_allocator<object>::allot(size);
+  object* allot(cell dsize) {
+    object* obj = free_list_allocator<object>::allot(dsize);
     if (obj) {
       starts.record_object_start_offset(obj);
       return obj;
@@ -28,8 +28,8 @@ struct tenured_space : free_list_allocator<object> {
   }
 
   cell next_object_after(cell scan) {
-    cell size = ((object*)scan)->size();
-    return next_allocated_object_after(scan + size);
+    cell dsize = ((object*)scan)->size();
+    return next_allocated_object_after(scan + dsize);
   }
 
   void sweep() {