Are you blogging on PH? Get your free blog.

View \TEST.PAS

Turbo Pascal Heap Debugger With Many Features

Submitted By: WEBMASTER
Rating: (Not rated) (Rate It)


{$M 16384,0,65536}

Program Test;

uses
  CRT,DOS,

  Heap,                 {  Intercept the allocation/deallocation routines. }
  HDebug10,             {  Flag errors to the user.  }
  MapInfo;              {  Get the offending unit name and line number.  }

Procedure Main;
  type
    A1 = Array[1..30000] of Integer;
  var
    i : Integer;
    P1,P2 : ^A1;
  Begin
    P1 := nil;
    Dispose(P1);
    for i := 1 to 2 do
      begin
        if (i = 2) then
          InterceptFatalHeapErrors := False;
        New(P1);
        New(P2);       { if i=2, the program should crash normally }
        Dispose(P1);
        Dispose(P1);
      end;
  End;

BEGIN
  ClrScr;

  MapFileName := 'test.map';
  HeapOn;

  Main;

END.

corner
© 1996-2008 CommunityHeaven LLC. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
North American business development: Nicolai Wadstrom. Publisher: Lars Hagelin.