delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/02/12:09:29

From: "Redifon" <engineering AT nospam DOT rmel DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Standard Library
Date: Tue, 2 Nov 1999 15:36:26 -0000
Message-ID: <941557021.28991.0.nnrp-12.d4e443d2@news.demon.co.uk>
References: <LI1S3.289$f5 DOT 12775 AT news2-hme0> <Pine DOT SUN DOT 3 DOT 91 DOT 991031094328 DOT 2988L-100000 AT is>
NNTP-Posting-Host: rmel2.demon.co.uk
X-NNTP-Posting-Host: rmel2.demon.co.uk:212.228.67.210
X-Trace: news.demon.co.uk 941557021 nnrp-12:28991 NO-IDENT rmel2.demon.co.uk:212.228.67.210
X-Complaints-To: abuse AT demon DOT net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Lines: 42
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Thanks for you help but I have two other questions.

Firstly, how do you make use of the size information within 'malloc' and
'free', when this is held locally and other functions do not has scope
access to these variables. This is why I was trying to modify free.
Secondly, where can I find the source and binaries for the heap debugging
libraries  that you mentioned

Steve



Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote in message
news:Pine DOT SUN DOT 3 DOT 91 DOT 991031094328 DOT 2988L-100000 AT is...
>
> On Thu, 28 Oct 1999, Steve wrote:
>
> > I am trying to write some heap monitoring utilities. For this I need to
> > modify the function "free" so that it returns an unsigned int,
indicating
> > how many bytes have been freed on the heap.
>
> Please explain why do you think you need to make such a modification
> in `free'.  I think you don't need this at all.  Simply read the
> source of `malloc' and `free', and you will see that any allocated
> block includes the information you want immediately before the block's
> start and after its end.  Use this information, and you will not need
> to modify any library functions.
>
> > 2) Which source file I need to download
>
> The sources of both `malloc' and `free' are in the file
> src/libc/ansi/stdlib/malloc.c that is part of djlsr202.zip.
>
> > By the way this is only for debug purposes,  I do not intending to leave
the
> > code in a modified state.
>
> Perhaps it is a better idea to use one of the available malloc
> debugging libraries instead.  Try MSS or YAMD, for example.


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019