Leveraging Metamemory Mechanisms for Enhanced Data-Free Code Generation in LLMs