当在内存中存储数据时,常常需要在运行时调整内存的大小,vector提供了一个安全、简易并且自动化的内存分配技术。基于时间效率、空间利用率方面的考虑,提出了几种修改内存增长机制的方法,并在此基础上,结合实际应用进行分析,从时间效率和空间利用率两方面对不同内存增长机制进行了比较,得出在实际应用中根据实际情况调整内存增长机制的方法。%Memory size is often modified in operation of storing data.Vector provides a safe,simple and automatic memory allocation technique.Regarding time efficiency and space utilization,the paper suggests several ways to modify the growth mechanism of memory.Based on practical application,the paper compares the different growth mechanisms of memory on time efficiency and space utilization,and develops some approaches of adjusting the memory growth mechanism in actual operation.
展开▼