add function alocate() and renew example.

add function alocate() and renew example.