I have some questions about the heap and paging in general. I have searched the wiki and Googled some of it (but for some reason didn't manage to find what I actually sought) so I decided (since I have more than one question and issue) to post it here.
So basically, after having used a clone of JamesM's tutorial heap for quite some time, I decided to write my own (with a first-fit algorithm for allocation). I know a binary tree can be more efficient and such, but this isn't really what I'm worried about (as it's actually the first time I got further than trashing my heap

SVN Repository (with the memory headers)
Either way, as far as I understand paging, (physical) memory is divided into pages of 4 kB each and addresses must be page-aligned. So does this mean I must page-align every address in the heap? I'm already aligning the start address of the heap, so I'm wondering about whether to align the end-address and each heap header's position too?
The second thing I wanted help with is a problem I'm experiencing. I was really happy when I noticed my allocation function was doing fine (which doesn't mean it doesn't contain any serious flaws or bugs) and even more happy when I saw that my Heap::_Expand function worked... at least that is what I thought. It seems that the heap expands correctly, but after a certain amount of expanding, it simply ends up with a page-fault. I find this strange because the heap manages to expand a while and then comes to a sudden end with a page-fault. Though since I'm confused about how to use paging exactly in the heap, this might very well be what's causing my problem.
Am I missing something obvious here, did I make a stupid mistake or is there some hard-to-fix bug somewhere in my code?
Thanks,
Creature