obj: change void* to uint64_t in alloc and free
obj: make data buffer persistent
obj: fix logging alloc

The alloc operation should be logged before allocating memory.