In my early years of GMing it was simple enough to say that the badguys were evil and that was all the justification we needed.  They are attacking the village because they are evil, they are stealing the princess because they are evil, etc.

Over time, my group needs have grown to need more complicated and detailed villains. It is important to consider motives.  What is it that defines them as 'evil' to the party?  In terms of a fantasy setting, what would you consider to be an interesting villain?

What qualities make a villain that inspires your party to rally against him?  What kind of villains have worked for your games in the past?

Example:


  A member of nobility is using trade connections to move valuable pieces of art into another country that is secretly paying him quite well and is framing a member of the party to take the fall.  In addition, someone important to the party member has been taken hostage with a promise of release once they party member takes the blame for the crime.



Question: Force garbage collection/compaction with malloc()
Answer: Their are a few pieces of garbage collection code out their. Look at perl/python/lua/ruby/mono/parrot/boehm/pike/slate/self/io etc etc. 
Also look at alloca() and dynamic arrays. Also consider using structs to implement your own destructor or using gcc attributes to call free when a function leaves scope.