Article View: comp.lang.pascal.borland
Article #204Re: Heap Checking
From: Robert AH Prins
Date: Tue, 15 Feb 2000 00:00
Date: Tue, 15 Feb 2000 00:00
55 lines
2542 bytes
2542 bytes
In article <ialr8soi9f73me4559hjt24ocjg7son4gs@4ax.com>,
Markus Kaemmerer <mk@happyarts.de> wrote:
> Robert AH Prins <prinsra@williscorroon.com> wrote:
>
> >Go to http://www.gdsoft.com/swag/ and download everything! :-) Or at
> >least the reader & memnory.swg... In the latter there are two
> >usefulish snippets, numbers 69 by Duncan Murdoch & 85 by Andy Cooper.
> >Both claim to be able to detect heap corruption.
>
> the routine 85 is exactly, what I am searching for. But this unit is
> written for TP 6.0, but I have only Version 7.0. In this unit the old
> getmem/new routines where subtituted with new getmem/new routines, but
> this dosn't seam to work in TP 7. Has anyone tryed to fix this unit
> for TP7? This would be very helpful for all users of TP 7.
This thread refuses to die :-)
I've finally had a look at this unit, and it does work, BUT ONLY IF IT
IS COMPILED IN G- STATE, unless you add some conditionals to it in the
"Find_Procs" procedure, ie:
mov bx, offset lgetmem
{$ifopt G+}
add bx, 3
{$endif}
{$ifopt G-}
add bx, 5
{$endif}
mov ax, word ptr [cs:bx]
and
mov bx, offset lfreemem
{$ifopt G+}
add bx, 9
{$endif}
{$ifopt G-}
add bx, 11
{$endif}
mov ax, word ptr [cs:bx]
the reason being the fact that the compiler generates "push immediate"
for both "getmem(tmp, 1)" and "freemem(tmp, 1)"
With the above conditionals the unit seems to work OK! (Very limited
test)
Robert
--
Robert AH Prins
prinsra@willis.com
Sent via Deja.com http://www.deja.com/
Before you buy.
Technical Details
Message-ID:
<88bl63$cen$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<sq6o8soca5c2368i3dbihhcpk008tm63d7@4ax.com> <86i3sv$oo8$1@nnrp1.deja.com> <o17p8scqrbkta9tk6gp1kfisjets75oauo@4ax.com> <86js5u$29k$1@nnrp1.deja.com> <ffvq8ske8bdvifb7aifubpeqal23s32dt7@4ax.com> <86kemk$f1v$1@nnrp1.deja.com> <ialr8soi9f73me4559hjt24ocjg7son4gs@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111659,6aa5a22c4c09a438 X-Google-Attributes: gid111659,public X-Google-Thread: 108ebd,b1ac468ba433a98d X-Google-Attributes: gid108ebd,public From: Robert AH Prins <prinsra@williscorroon.com> Subject: Re: Heap Checking Date: 2000/02/15 Message-ID: <88bl63$cen$1@nnrp1.deja.com> X-Deja-AN: 585967390 References: <sq6o8soca5c2368i3dbihhcpk008tm63d7@4ax.com> <86i3sv$oo8$1@nnrp1.deja.com> <o17p8scqrbkta9tk6gp1kfisjets75oauo@4ax.com> <86js5u$29k$1@nnrp1.deja.com> <ffvq8ske8bdvifb7aifubpeqal23s32dt7@4ax.com> <86kemk$f1v$1@nnrp1.deja.com> <ialr8soi9f73me4559hjt24ocjg7son4gs@4ax.com> X-Http-Proxy: 1.0 x42.deja.com:80 (Squid/1.1.22) for client 193.130.234.1 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Tue Feb 15 13:43:31 2000 GMT X-MyDeja-Info: XMYDJUIDprino Newsgroups: comp.lang.pascal.borland,borland.public.turbopascal X-Http-User-Agent: Mozilla/4.05 [en] (WinNT; I)