aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/memsize.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/memsize.c b/common/memsize.c
index 6dc4bb2..c315275 100644
--- a/common/memsize.c
+++ b/common/memsize.c
@@ -77,9 +77,16 @@ long get_ram_size(long *base, long maxsize)
addr = base + cnt;
*addr = save[--i];
}
+ /* warning: don't restore save_base in this case,
+ * it is already done in the loop because
+ * base and base+size share the same physical memory
+ * and *base is saved after *(base+size) modification
+ * in first loop
+ */
return (size);
}
}
+ *base = save_base;
return (maxsize);
}