[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: doc on memory management
From: |
Yoshinori K. Okuji |
Subject: |
Re: doc on memory management |
Date: |
Tue, 2 Aug 2005 22:41:16 +0200 |
User-agent: |
KMail/1.7.2 |
On Tuesday 02 August 2005 18:19, Vincent Pelletier wrote:
> I wonder why the region header contains, to me, a useless field : addr.
It is useful when debugging the code.
> I see a light improvement in grub_mm_init_region :
> /* If this region is too small, ignore it. */
> if (size < GRUB_MM_ALIGN * 2)
> return;
> If the region is 2*GRUB_MM_ALIGN, we can put a grub_mm_header_t plus a
> grub_mm_region_t, and it would be full. Maybe adding 1 byte (or more)
> might make more sense (but has it any practical impact...).
That check is put only to avoid a strange error.
> My realloc implementation handled the case where the realloc'ed block
> had enough space after to expand. I might send a patch for this someday
> if anyone finds it interesting to add.
I'm not sure if it is really meaningful. Only if you can prove that your
implementation improves something (such as memory efficiency), I will
incorporate it.
> I also implemented a memory defrag that merges successive free chunks in
> one bigger. Although it relied on the fact both alloc'ed and free chucks
> are known I think it can be adapted (if h->next != h+h->size*16, don't
> merge h and h->next) and even a bit faster (as we only see free chunks).
The current implementation merges free regions. What is bad?
Okuji