Lesson 7: Losing My Memory

Blog post by darkwyrm on Sat, 2010-02-27 00:56

It's hard for me to believe that I've been publishing these mostly-weekly lessons for almost a month and a half. It's been really fun. I hope that those of you reading them have been enjoying reading (and hopefully learning from) them as I have in writing them. This one covers two major topics: memory management and binary math, nothing terribly exciting, but really useful and necessary nonetheless. Learn to Program With Haiku, Lesson 7.

Comments

Re: Lesson 7: Losing My Memory

Thanks for these tutorials, very useful. Can't wait to start diving into the Haiku API.

Re: Lesson 7: Losing My Memory

I agree! Very nice tutorials, and I am also eager to see when you arrive to the HAIKU API specific part. :)

Re: Lesson 7: Losing My Memory

The calloc() signature given is not correct. For some (probably weird) reasons it has two arguments:
http://www.opengroup.org/onlinepubs/9699919799/functions/calloc.html

Re: Lesson 7: Losing My Memory

On page 7, in the XOR example, you listed 36 as 0b00010100, instead of 0b00100100. This was confounding me when I was performing the XOR in my head and couldn't see how you got a 1 in the 16's place, and a 0 in the 32's place.

This is a great tutorial though, good job!

Re: Lesson 7: Losing My Memory

bonefish wrote:

The calloc() signature given is not correct. For some (probably weird) reasons it has two arguments:
http://www.opengroup.org/onlinepubs/9699919799/functions/calloc.html

tcucco wrote:

On page 7, in the XOR example, you listed 36 as 0b00010100, instead of 0b00100100. This was confounding me when I was performing the XOR in my head and couldn't see how you got a 1 in the 16's place, and a 0 in the 32's place.

This is a great tutorial though, good job!

Thanks for pointing out the errata, guys! I've made the necessary corrections and appreciate having them pointed out. :)