lkml.org 
[lkml]   [2014]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] perf tools: fix off-by-one error in maps
Em Tue, Oct 07, 2014 at 01:58:38PM -0500, Chuck Ebbert escreveu:
> On Tue, 7 Oct 2014 11:00:50 -0300
> Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
>
> > I keep thinking that this change is making things unclear.
> >
> > I.e. the _start_ of a map (map->start) is _in_ the map, and the _end_
> > of a map (map->end) is _in_ the map as well.
> >
> > if (addr > m->end)
> >
> > is shorter than:
> >
> > if (addr >= m->end)
> >
> > "start" and "end" should have the same rule applied, i.e. if one is in,
> > the other is in as well.
> >
> > Etc.
> >
>
> But the convention used in the memory management code is that "end" is
> the next byte after the memory region. This gives you:
>
> size = end - start
> end = start + size
>
> Using a different convention here will just confuse people used to the
> way it's done everywhere else.

So we should continue using some confusing convention because that is
the way that things are? :-\

- Arnaldo


\
 
 \ /
  Last update: 2014-10-08 18:22    [W:0.075 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site