Fixed a bug in memory allocation.
AllocateCodeBuffer may return the same address multiple times.