| /* 输入参数*/ ADDRESS triggerAddr SIZE triggerSize LIST a list of tracked heap ranges IF (the virtual memory at triggerAddr is tracked on the list as part of a heap range) DO IF (triggerAddr + triggerSize > (the tracked upper boundary of that heap range)) DO /* 一个现有的堆范围被扩展 */ make system call(s) to determine the base and extent of the newly committed range that contains the addresses from triggerAddr to (triggerAddr + triggerSize) update the size of the tracked heap range to indicate its new upper limit END END ELSE DO /* 在triggerAddr中有一个新的堆范围 */ make system call(s) to determine the base and extent of the newly committed range that contains the addresses from triggerAddr to (triggerAddr + triggerSize) track the new committed range in the list of heap ranges END |
| /* 输入参数 */ ADDRESS triggerAddr SIZE triggerSize LIST a list of tracked heap ranges /* 局部变量 */ ADDRESS origRangeBase SIZE origRangeSize BOOL bFoundChange bFoundChange = FALSE IF (the virtual memory at triggerAddr is not tracked on the heap range list as part of a heap range) DO /*似乎我们已经清楚此次释放了。*/ END ELSE IF (an access exception occurs when memory at triggerAddr is read) DO bFoundChange = TRUE END IF (bFoundChange) DO /*因为之前内存块占用的空间被释放了,所以堆占用的虚拟内存范围就改变了。*/ make system calls to determine the bases and extents of the tracked committed heap ranges in the immediate vicinity of the decommitted range that includes the addresses from triggerAddr to (triggerAddr + triggerSize) /*更新堆范围跟踪,以反映剩余提交的范围 */ IF (any portion of the tracked heap range that contained the block at TriggerAddr is still committed) DO update the heap range list to track just the portion(s) of that range that remain committed END ELSE DO delete the list element that tracks the range END END |
最新相关文章
发表评论