buddy implementation in c