From: Razetime Date: Sun, 12 Feb 2023 15:39:05 +0000 (+0530) Subject: basic shadowed name changes X-Git-Tag: 0.99~466^2~1 X-Git-Url: https://gitweb.factorcode.org/gitweb.cgi?p=factor.git;a=commitdiff_plain;h=64bcc37da6d936bbcfa903229bf3601c3f698c7f basic shadowed name changes --- diff --git a/.gitignore b/.gitignore index a4d2fe8cee..c89b3eaba8 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ .*.swp .DS_Store .gdb_history +.vs /factor /logs /work diff --git a/Nmakefile b/Nmakefile index 065d24a757..d92e5ee2d1 100644 --- 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 $< diff --git a/vm/aging_space.hpp b/vm/aging_space.hpp index fc6c150d62..89c2f797fd 100644 --- a/vm/aging_space.hpp +++ b/vm/aging_space.hpp @@ -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; } diff --git a/vm/allot.hpp b/vm/allot.hpp index 1987b2b0e4..446f36b2db 100644 --- a/vm/allot.hpp +++ b/vm/allot.hpp @@ -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; diff --git a/vm/bump_allocator.hpp b/vm/bump_allocator.hpp index 28aa527fd4..aeb9638762 100644 --- a/vm/bump_allocator.hpp +++ b/vm/bump_allocator.hpp @@ -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; } diff --git a/vm/mark_bits.hpp b/vm/mark_bits.hpp index efd66b339c..e7600e2417 100644 --- a/vm/mark_bits.hpp +++ b/vm/mark_bits.hpp @@ -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 start = bitmap_deref(address); - std::pair end = bitmap_deref(address + size); + void set_bitmap_range(cell* bits, const cell address, const cell dsize) { + std::pair bstart = bitmap_deref(address); + std::pair 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 diff --git a/vm/tenured_space.hpp b/vm/tenured_space.hpp index 2fff0515ad..739ba90390 100644 --- a/vm/tenured_space.hpp +++ b/vm/tenured_space.hpp @@ -6,8 +6,8 @@ struct tenured_space : free_list_allocator { tenured_space(cell size, cell start) : free_list_allocator(size, start), starts(size, start) {} - object* allot(cell size) { - object* obj = free_list_allocator::allot(size); + object* allot(cell dsize) { + object* obj = free_list_allocator::allot(dsize); if (obj) { starts.record_object_start_offset(obj); return obj; @@ -28,8 +28,8 @@ struct tenured_space : free_list_allocator { } 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() {