Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2358

Re: Buddy System Memory Allocator

From "BartC" <bc@freeuk.com>
Newsgroups comp.programming
Subject Re: Buddy System Memory Allocator
Date 2012-10-19 15:04 +0100
Organization A noiseless patient Spider
Message-ID <k5ro9b$cg2$1@dont-email.me> (permalink)
References <_Iges.3$jY.2@fx25.am4> <1731845837372288843.910496pjb-informatimago.com@news.individual.net>

Show all headers | View raw


"Pascal J. Bourguignon" <pjb@informatimago.com> wrote in message 
news:1731845837372288843.910496pjb-informatimago.com@news.individual.net...
> "Mark" <mark@dibsco.co.uk> wrote:

>> of memory and want a relatively small minimum block size. A bitmap of 32
>> bits will only give me coverage for 8k of memory if I use a minimum block
>> size of 256 bytes. I am trying to figure out how to avoid having a bitmap
>> that is hundreds or thousands of bits long. I'm sure that there must be a 
>> better way.

> The simpliest is to keep the size with the allocated blocks: allocate a
> word more than requested, to store the size, and return the addess of the
> first byte after the size.  You may want to still return aligned pointers
> so you may want to store the size on a smaller alignment.

He's complaining about having to use a 4 byte bitmap for every 8KB (1 bit 
per 256 bytes).

Your way might need 4 bytes for every 256 bytes! And could introduce 
alignment issues (260 bytes per block also sound as a bit awkward).

-- 
bartc 

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Buddy System Memory Allocator "Mark" <mark@dibsco.co.uk> - 2012-10-13 17:32 +0100
  Re: Buddy System Memory Allocator "BartC" <bc@freeuk.com> - 2012-10-14 16:33 +0100
  Re: Buddy System Memory Allocator Pascal J. Bourguignon <pjb@informatimago.com> - 2012-10-19 12:24 +0000
    Re: Buddy System Memory Allocator "BartC" <bc@freeuk.com> - 2012-10-19 15:04 +0100
      Re: Buddy System Memory Allocator Pascal J. Bourguignon <pjb@informatimago.com> - 2012-10-19 16:37 +0000

csiph-web