TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: David Nugent
date: 1996-06-18 03:29:24
subject: Memory Blocks snuffed ?

> Tested in TC2 and BC4, worked correctly in both.
 > This function will return the size of the memory block held by a pointer.
 > It will do a realloc too, according to parameter 2 and 3.

BTW, are you aware that most if not all implementations of realloc() do not
normally do anything if you pass it the same block size?  This sounds too
much like a search for a square wheel to me.


 > Keeping in mind it's Borland specific code, but other compilers may have
 > a similar function.

There are no guarantees.  The C standard library describes an interface,
and does not normally determine how that interface should be implemented.
Since memory allocation is by and large very system specific, you're going
way out on a limb using code that will only likely work on two versions of
two specific compilers. Very likely it also depends on which platform
you're compiling for (did you try this with a Windows program, for
example?).

I'm still not sure what you're attempting to achieve that realloc() does
not do already.

--- MaltEd/2 1.0.b6
* Origin: Unique Computing Pty Limited (3:632/348)
SEEN-BY: 50/99 620/243 623/630 632/103 107 348 360 633/371 634/388 396
SEEN-BY: 635/301 502 503 506 544 639/252 711/401 409 410 413 430 808 809 932
SEEN-BY: 711/934 712/515 713/888 714/906 800/1
@PATH: 632/348 635/503 50/99 711/808 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.