LWN.net Logo

Eric's making sense, but it's moot atealloc() considered harmful!

Eric's making sense, but it's moot atealloc() considered harmful!

Posted Aug 22, 2003 11:26 UTC (Fri) by RobDavies (guest, #9930)
Parent article: Maybe SCO had a point

Ask yourself, if you copy & pasted the ancient code, and were debugging a
driver. What ASSERT's would be useful, and where would you put them?

It's natural to add an assertion right at beginning of function to check
arguments. Yes, it's sub-optimal in this case, but very often it is not
worth the time costs, of using an unusual layout. If the code was copied,
it seems odd decision to move it in that way.

The addition of locking is dictated by functional requirements, that
similarity is a red-herring.

Now, suppose Sys V code was copied, the malloc wrapper goes, rmalloc
changed name to atealloc. But then why would the register storage class
specifier be removed on the parameters?

I think the white space changes would be interesting, and ought not be
excluded. Precisely because of it's non-significance, should the Linux
version share idiosyncratic white space with the Sys V version, I would
change my view, but from what's shown, the Linux version does look like
it's come from 32V.

Now there's no questioon this code will be removed from 2.4, it is not
necessary to write your own memory allocater! Really all Marcello needs
to decide now, is whether to use the 2.6 fix, or play safe and pull the
whole driver as unused and potentially tainted, until SGI care to comment
on it's originality and explain, from where and why borrowed code was
added to the kernel.


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds