https://bugs.kde.org/show_bug.cgi?id=487862

--- Comment #7 from Paul Floyd <pjfl...@wanadoo.fr> ---
As to implementing this, my idea is to add a new variable VG_(brk_high_tide)
that starts off the same as VG_(brk_limit),

If ever VG_(brk_limit) is increased beyond VG_(brk_high_tide) then a new
VG_(track_new_init_mem_brk) gets used (and the high tide updated). If
VG_(brk_limit) gets increased but doesn't exceed VG_(brk_high_tide) (because
VG_(brk_limit) got decreased in the meantime) then the existing
VG_(track_new_mem_brk) gets used.

VG_(track_new_init_mem_brk) will use make_mem_defined_w_tid.

So instead of

      if (brk_new > brk_limit) {
         /* successfully grew the data segment */
         VG_TRACK( new_mem_brk, brk_limit,
                   ARG1-brk_limit, tid );
      }

it would be

      if (brk_new > brk_limit) {
         /* successfully grew the data segment */
         if (brk_new > brk_high_tide) {
            VG_TRACK( new_init_mem_brk, brk_limit,
                      ARG1-brk_limit, tid );
         } else {
            VG_TRACK( new_mem_brk, brk_limit,
                      ARG1-brk_limit, tid );
         }
      }

This doesn't model what is happening to physical memory (initialized pages
being mapped) but I do think that it more closely represents what the guest
should be seeing.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to