From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,d6f2cd7e30072b27,start X-Google-Attributes: gid1164f8,public X-Google-Thread: 1014db,d6f2cd7e30072b27,start X-Google-Attributes: gid1014db,public X-Google-ArrivalTime: 1994-09-02 11:35:15 PST Path: bga.com!news.sprintlink.net!redstone.interpath.net!ddsw1!panix!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!jussieu.fr!centre.univ-orleans.fr!univ-lyon1.fr!swidir.switch.ch!newsfeed.ACO.net!fstgds15.tu-graz.ac.at!piis10.joanneum.ac.at!thalli From: thalli@piis10.joanneum.ac.at (Georg Thallinger (IIS)) Newsgroups: comp.lang.c,comp.sys.dec Subject: Problems with realloc on DECstation Date: 2 Sep 1994 17:17:07 GMT Organization: Joanneum Research, Graz, Austria Distribution: world Message-ID: <347mmj$9gi@fstgds15.tu-graz.ac.at> Reply-To: thalli@piis10.joanneum.ac.at (Georg Thallinger (IIS)) NNTP-Posting-Host: piis10.joanneum.ac.at Xref: bga.com comp.lang.c:23065 comp.sys.dec:5620 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 = { 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 ! ! / /__ (______)