Cisco interview question

How would you implement malloc()?