TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: David Nugent
from: Frank Adam
date: 1996-01-16 12:43:12
subject: Realloc

G'Day David,

-=> Quoting David Nugent to Frank Adam <=-

 FA> Don't forget to cast those to a long, if the allocated
 FA> memory goes passed 655?? i forget:)..
 FA> it'll wrap around to 0 and that's what you'll
 FA> allocate.Hence bye-bye data.

 DN> A long here would be incorrect. realloc() accepts a size_t only in
 DN> this  position. If you use a brain-damaged 16-bit environment, 
 DN> then you're up the creek if you attempt to use > 64K here 
 DN> regardless of how you cast it.
Yep, i was referring to an earlier post by him, and he asked about 
farrealloc() at the time. I should've read the message more carefully.

 DN> Borland have some soother functions with frealloc() (or 
 DN> farrealloc()?) which does accept a long, but you need to 
 DN> realise that these functions are entirely non-standard.
That's ok, he doesn't care ;)

I just looked it up, you're right it's non ANSI, but then how do i allocate 
more than 64Ks at a time portably ? I think new isn't ANSI either, not to 
mention that it's C++ only. 

                            
  L8r Frank (fadam{at}ozemail.com.au)

___ Blue Wave/DOS v2.21

--- Maximus 3.00
* Origin: The Software Parlour (3:635/544)
SEEN-BY: 50/99 620/243 623/630 632/349 635/503 544 711/401 409 410 413 430
SEEN-BY: 711/510 808 809 932 934 712/515 713/888 714/906 800/1 7877/2809
@PATH: 635/544 50/99 711/808 809 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™.