Thursday, February 9, 2012

Mem: Major Break Through

So I've been working on the Memory system diligently over the last couple of days. I'm racking up a bunch of days in a row where I stay up until 3AM working on it. Thank GOD I switched to part time at work, otherwise I would be no where near as complete as I am. Keenan excused the class from one section of the homework (the file system), and this has really made a difference. I don't think there is any way I would've finished all of it if he hadn't.  It is supposedly the easiest of the four systems. Regardless, I'm going to scour the part he let us off the hook on and make sure I really understand it, because that's the point of learning, right? 

Anyway,  I'm mainly posting today because I had a major break through on the mem system.  There are 40 different tests and for the longest time I had only been able to get 1 of them to pass. It was very frustrating because I was coding and coding and coding and nothing felt like it was making progress. Finally, last night I finished the bare necessities to get a second test to pass and slowly but surely the tests started getting checked off one by one. In some cases I even completed parts that made 3 or more tests pass at once.

 For some reason or another early on in the process I had worked on overloading new and delete. I really should have waited on that and gotten the heaps and global mem systems working, but these overloads are crucial to getting a large number of the tests to pass as that is how your allocations are created.  Something about how I implemented them was making the whole system crash and so I had decided to comment them out and move on. Despite this I had thought the way I implemented them was correct as I had it working on one of my previous experiments. This was validated during class as we walked through the best implementation. When I moved on to other problems, in my head I had decided I was finished with the problem.  As I started cranking through the unit tests I was having a lot of trouble with a couple of info( )'s not coming through correctly.  I scoured through my heap implementations and my mem implementations and my getinfo( ) implementations to try and find the answer to my problem.  as soon as i realized my new[] and delete[] were commented out i had a major facepalm moment. I simply removed the comments and voila!  12 more tests passed instantly.  What a great feeling.   only 3 tests left. I think I'll save them for tomorrow.

On a somewhat related note I bumped into Keenan on the way to my other class and we had a mini-discussion about how this class is going. I told him I'm really enjoying it and I actually meant it when I said it to him.  Don't get me wrong, this class is tough, and I've probably spent more time on homework than in any other class.  But I really am learning so much.  My programming confidence is skyrocketing right now. ... then again I spoke with some of my classmates today in the class I was headed to after talking with Keenan and word on the street is that Game Engines 2 is even harder than this one. Hard to believe at this point in time, but I won't be surprised either.

-Aaron

No comments:

Post a Comment