www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/04/22:30:05

Date: Fri, 5 Mar 1999 09:17:05 +0530 (IST)
From: "Raju K.V" <rajukv AT wipinfo DOT soft DOT net>
X-Sender: rajukv AT tagore
To: djgpp AT delorie DOT com
Subject: how to know the size of allocated memory
Message-ID: <Pine.SV4.3.93.990304205056.29767A-100000@tagore>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

hi,

I have written a library say libxx.a. Suppose we have a function yy()
which takes a char * as argument. In the user application, the user
allocates some memory using malloc and passes the pointer to the allocated
memory  as arguement to yy(). The previous implementation of function was
very simple. But a new requirement is to check the amount of memory that
the user has allocated. Is there any way by which I can find the length of
the allocated memory block, given a pointer to the block?  
I dont want to change the user interface. The user should not be aware of
the change in the implementation of function yy().

Thanks
Raju

- Raw text -


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