🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4497

Re: Should free() take a pointer to const argument?

#4497
From: Tanmoy Bhattacharya
Date: Sun, 17 Dec 1995 17:53
28 lines
1922 bytes
In article <1995Dec16.001438.2515@grendel.demon.co.uk>, Jim Segrave
<jes@grendel.demon.co.uk> writes: 
<snip>
|> >Of course, if the byte values are identical, any reasonable
interpretation of 
|> >the standard will say that the pointer is unchanged.
|> 
|> One could imagine a CPU which had a virtual memory system tighly
|> coupled to am allocator in which malloc() simply returned an index to
|> some internal table within the CPU which mapped the memory. In this
|> case, the object may have been copied, altered in size or packing or
|> whatever, and given the same table entry. The pointer, viewed as a
|> string of bytes would remain unchanged, the object pointed to might
|> well have been moved and altered internally.

When I meant unchanged, I meant only that other pointers pointing to the same
place continue to remain valid. In the implementation you describe, I would
call the object `unchanged'.

Cheers
Tanmoy
-- 
tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
<http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
Technical Details
Message-ID: <4b1lfl$4te@newshost.lanl.gov>
Path: arc1-ca.pugleaf.net!qcd.lanl.gov!tanmoy
References: <818898225snz@genesis.demon.co.uk> <4apkl2$8sp@rdsunx.crd.ge.com> <4apn8t$bs8@newshost.lanl.gov> <1995Dec16.001438.2515@grendel.demon.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!qcd.lanl.gov!tanmoy
From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
Newsgroups: comp.std.c
Subject: Re: Should free() take a pointer to const argument?
Date: 17 Dec 1995 17:53:57 GMT
Organization: Los Alamos National Laboratory
Distribution: world
Message-ID: <4b1lfl$4te@newshost.lanl.gov>
References: <818898225snz@genesis.demon.co.uk> <4apkl2$8sp@rdsunx.crd.ge.com> <4apn8t$bs8@newshost.lanl.gov> <1995Dec16.001438.2515@grendel.demon.co.uk>
NNTP-Posting-Host: qcd.lanl.gov