소스 검색

* heap manager: do not access chunk after last one

git-svn-id: trunk@7497 -
micha 18 년 전
부모
커밋
eaa598094e
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      rtl/inc/heap.inc

+ 3 - 2
rtl/inc/heap.inc

@@ -1215,8 +1215,9 @@ begin
        We first check if the blocks after the current block are free. If not then we
        simply call getmem/freemem to get the new block }
      pnext:=pmemchunk_var(pointer(pcurr)+currsize);
-     if ((pnext^.size and usedflag) = 0) 
-        and ((pnext^.size and sizemask) > size-currsize) then
+     if ((chunksize and lastblockflag) = 0)
+        and ((pnext^.size and usedflag) = 0) 
+        and ((pnext^.size and sizemask) >= size-currsize) then
        begin
          concat_two_blocks(pcurr,pnext);
          currsize := pcurr^.size and sizemask;