All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Timur Tabi <timur@freescale.com>
Cc: linuxppc-dev@ozlabs.org, Sylvain Munaut <tnt@246tNt.com>
Subject: Re: [PATCH] powerpc: change rheap functions to use long integers instead of pointers
Date: Wed, 04 Apr 2007 13:31:59 -0500	[thread overview]
Message-ID: <4613EF1F.6000704@freescale.com> (raw)
In-Reply-To: <4613EE2C.3070104@freescale.com>

Timur Tabi wrote:
> Scott Wood wrote:
> 
>>> The same patch should be applied to rh_detach_region() and 
>>> rh_alloc_fixed().
>>
>>
>> You should check "e" instead, and make sure that s < e.
> 
> 
> Now that I look at the code, I think there's a bug in the calculation of 
> 'e'.  'e' is rounded down, and it's based on the unaligned value of 
> 'start'.  Instead, 'size' should be rounded up, and 'e' should be based 
> on 's' (i.e. the aligned value of 'start').
> 
> Otherwise, if you pass an unaligned value of 'start', then the buffer 
> you get back will be less than 'size'.

That's better than the buffer you get back being bigger than the region 
that's really free...

If I attach a region from 0x03 to 0x2d, and the alignment is 4, then the 
only sane thing to do is allocate from 0x04 to 0x2b.

-Scott

  reply	other threads:[~2007-04-04 18:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-03 16:02 [PATCH] powerpc: change rheap functions to use long integers instead of pointers Timur Tabi
2007-04-04 16:42 ` Kumar Gala
2007-04-04 17:36   ` Pantelis Antoniou
2007-04-04 17:42   ` Timur Tabi
2007-04-04 18:00     ` Sylvain Munaut
2007-04-04 18:05       ` Timur Tabi
2007-04-04 18:13       ` Timur Tabi
2007-04-04 19:15         ` Dan Malek
2007-04-04 19:20           ` Timur Tabi
2007-04-04 19:31             ` Sylvain Munaut
2007-04-04 18:13       ` Scott Wood
2007-04-04 18:19         ` Timur Tabi
2007-04-04 18:24           ` Scott Wood
2007-04-04 18:27             ` Timur Tabi
2007-04-04 18:31               ` Scott Wood [this message]
2007-04-04 18:34                 ` Timur Tabi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4613EF1F.6000704@freescale.com \
    --to=scottwood@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=timur@freescale.com \
    --cc=tnt@246tNt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.