Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: thalli@piis10.joanneum.ac.at (Georg Thallinger (IIS))
Subject: Problems with realloc on DECstation
Date: 2 Sep 1994 17:17:07 GMT	[thread overview]
Message-ID: <347mmj$9gi@fstgds15.tu-graz.ac.at> (raw)


I am using realloc to dynamically augment an array.
According to my interpretation of the man page realloc should copy the data
if the block of memory has to be moved.

I used the debugger to keep track of the values:

(gdb) p *Mesh->lcv@20
$3 = {3, 5, 239, 459, 4, 240, 461, 238, 5, 7, 241, 239, 6, 242, 462, 240, 7, 
9, 243, 241}

	tmp = realloc(...);
(gdb) p *(int*)tmp@20
$4 = { <repeats 20 times>0}

So the data are obviousely not copied. Whats wrong [-( ? Is my interpretation 
of the man page wrong, or is the malloc library incorrect. 

I tried to link the malloc library explicitely but it didn't help either.

Thanks for any help
 
Georg

    _--_     _--_             
   (    )~~~(    )
    \           /		
     (  ' _ `  )		Georg THALLINGER                    
      \       /			Institute for Information Systems
    .__( `-' )  ___		JOANNEUM RESEARCH
   /   /`---'`-'   \            Graz / AUSTRIA / Europe
  /   /          ._/   __
/'   /.-----\___/     /  )
\___//          `----'   !	e-mail: thallinger@pbox.joanneum.ac.at  
     \            ______/	        thallinger@joanneum.ada.at    
      `--_____----'		phone:  (++43/316) 876 240
       \    /			fax:	(++43/316) 876 191
        !   !
        /  /__
       (______)


                 reply	other threads:[~1994-09-02 17:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox