Manual memory management for code environment