Browse Source

* Optimized some code.

daniel 27 years ago
parent
commit
3a2a212930
1 changed files with 6 additions and 5 deletions
  1. 6 5
      rtl/i386/heap.inc

+ 6 - 5
rtl/i386/heap.inc

@@ -557,8 +557,7 @@
            end;
            end;
 {$endif TEMPHEAP}
 {$endif TEMPHEAP}
          { calc to multiply of 8 }
          { calc to multiply of 8 }
-         if (size and 7)<>0 then
-           size:=size+(8-(size and 7));
+         size:=(size+7) and not 7;
          dec(_memavail,size);
          dec(_memavail,size);
 {$ifdef UseBlocks}
 {$ifdef UseBlocks}
          { search cache }
          { search cache }
@@ -776,8 +775,7 @@ check_new:
        end;
        end;
 {$endif CHECKHEAP}
 {$endif CHECKHEAP}
          { calc to multiple of 8 }
          { calc to multiple of 8 }
-         if (size and 7)<>0 then
-           size:=size+(8-(size and 7));
+         size:=(size+7) and not 7;
          inc(_memavail,size);
          inc(_memavail,size);
          if p+size>=heapptr then
          if p+size>=heapptr then
            heapptr:=p
            heapptr:=p
@@ -1080,7 +1078,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  1998-03-31 19:01:41  daniel
+  Revision 1.3  1998-04-09 08:32:14  daniel
+  * Optimized some code.
+
+  Revision 1.2  1998/03/31 19:01:41  daniel
   * Replaced 'mod 8' with 'and 7'. Generates more efficient code.
   * Replaced 'mod 8' with 'and 7'. Generates more efficient code.
 
 
   Revision 1.1.1.1  1998/03/25 11:18:43  root
   Revision 1.1.1.1  1998/03/25 11:18:43  root