[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

superflouus instruction gnumach/ipc/ipc_object.c

From: Marcus Brinkmann
Subject: superflouus instruction gnumach/ipc/ipc_object.c
Date: Wed, 9 May 2001 00:54:50 +0200
User-agent: Mutt/1.3.15i


I think I found this confusing instruction to be unnecessary:

mach:/ipc/ipc_object.c (ipc_object_alloc.c), line 250:

-         *namep = (mach_port_t)object;
          kr = ipc_entry_alloc(space, namep, &entry);

(With "-", I mean that this line can be removed).

First, I find it confusing because what it does is set the port name to the
address of he underlying ipc (port) object.  The types absolutely don't
match (logically).

Second, the instruction does nothing useful, as namep is overwritten in
ipc_entry_alloc() (really in ipc_entry_get()) with the real name port on
success.  If allocation fails, the ipc object is freed and the pointer
"object" is invalid.

I suggest removing this line from the code.

BTW, do you think there is value in looking at other Machs and analysing
differences? Maybe there are bug fixes or improvements which we can merge
into gnumach.


`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann              GNU    http://www.gnu.org    marcus@gnu.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]