How the free implemented

  • Thread starter OperaHelloMarch
  • Start date
K

Karl Malbrain

At about the time of 3/4/2007 1:11 AM, (e-mail address removed) stated
the following:














There's got to be more to it than that. Make that alot more.

No, there doesn't need to be more. Marking the block available with a
bit is all it takes. The allocation routine does all the work
examining adjacent bits, etc.

For an example, check out my bit-mapped memory allocator (the free
bits are assembled into separate words, external to the memory block)
at www.geocities.com/malbrain

karl m
 
B

Ben Pfaff

I don't think a special value is a good idea, Maybe I should go and
study the source code of glibc.

Why don't you like it? Don't you like it when software helps you
find bugs in your programs?
 
K

Keith Thompson

Keith Thompson said:
Agreed. Yet another good rule: never do *anything* just to get rid of
a warning, without understanding what you're doing.

To elaborate on that, Flash's statement is more than just a single
instance of what I stated as a general rule. The difference is that
adding a cast is *only rarely* the right solution. If you're trying
to get rid of a warning, you should understand what the real
underlying problem is; in most cases, if you know what you're doing,
the solution will be something other than a cast.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top