why do you need malloc here?
Looking the PDF over again you don't need malloc, that was a quirk of our implementation. We had separated public/private structs, meaning private variables were inaccessible by non-class methods (and thus also unable to be instantiated statically by other code modules.)
(Our implementation was not very good.)
That said, I would recommend it as a good learning experience.