Linux-Advocacy Digest #903, Volume #30           Fri, 15 Dec 00 13:13:06 EST

Contents:
  Re: OS and Product Alternative Names - Idiocy in action (Ian Davey)
  Re: Nobody wants Linux because it destroys hard disks. (Swangoremovemee)
  Re: Red hat becoming illegal? (Ilja Booij)
  Why use malloc? (Aaron Ginn)
  Re: Red hat becoming illegal? (Donovan Rebbechi)
  Re: I concede (Windows back on my machine) (Donn Miller)
  Re: Red hat becoming illegal? (Donovan Rebbechi)
  Re: I concede (Windows back on my machine) (Donovan Rebbechi)
  Re: Why use malloc? (Brian Langenberger)
  Re: A Microsoft exodus! (The Ghost In The Machine)
  Re: A Microsoft exodus! (The Ghost In The Machine)
  Re: A Microsoft exodus! ([EMAIL PROTECTED])
  Re: A Microsoft exodus! ([EMAIL PROTECTED])
  Re: Another UNIX sight is doun! (Andres Soolo)
  Re: A Microsoft exodus! ([EMAIL PROTECTED])
  Re: A Microsoft exodus! ("Ayende Rahien")
  Re: Why use malloc? (Gary Hallock)
  Re: Why use malloc? (Andres Soolo)

----------------------------------------------------------------------------

From: [EMAIL PROTECTED] (Ian Davey)
Subject: Re: OS and Product Alternative Names - Idiocy in action
Date: Fri, 15 Dec 2000 15:59:25 GMT

In article <[EMAIL PROTECTED]>, chrisv <[EMAIL PROTECTED]> 
wrote:
>"Aaron R. Kulkis" <[EMAIL PROTECTED]> wrote:
>
>>But INFERIOR OPERATING SYSTEMS ==> Inferior applicatoins.
>>
>>There's no getting around this.
>
>Wrong again.  While Windoze is undeniably a crappy OS, it does have
>the best apps, both in quality and quantity.  Obviously with some
>exceptions to the rule.

Which apps are they? Statements like that tend to be subjective rather than 
purely factual, so it'd be helpful to know which you were referring to. The 
problem with running a good app on a crappy OS is that it is similar to 
building a sturdy house on a swamp, if the OS collapses beneath your app 
there's not a lot you can do (or it lets another buggy app sabotage the 
memory used by your quality app). 

Some of the apps on Linux may be in varying stages of development, but at 
least you know that when they reach finality they'll have a nice stable 
foundation.

Once perfect example of a very popular but poor quality app is Office. One of 
the most crash laden applications I have ever had the mispleasure to run. Not 
only does it crash, but often achieves it half way through saving, so not even 
the MS mantra of "save often" can help you.

ian.


 \ /
(@_@)  http://www.eclipse.co.uk/sweetdespise/ (dark literature)
/(&)\  http://www.eclipse.co.uk/sweetdespise/libertycaptions/ (art)
 | |

------------------------------

From: Swangoremovemee<[EMAIL PROTECTED]>
Crossposted-To: alt.linux.sux
Subject: Re: Nobody wants Linux because it destroys hard disks.
Reply-To: [EMAIL PROTECTED]
Date: Fri, 15 Dec 2000 16:06:53 GMT

On Fri, 15 Dec 2000 08:12:47 GMT, kiwiunixman
<[EMAIL PROTECTED]> wrote:

>Oh, so you're one of those lusers who believe because the OS has a GUI 
>it is superior to one that doesn't, so by your definition os/390 (the OS 
>used on IBM Mainframes) is shit because it has no dandy, randy, eye 


No, actually I think he is saying that USB support sucks under Linux,
and he gave the technical reasons to prove his point.

What's the problem with that?

Can you dispute his technical points?

If not, why are you jumping all over him?

Swango

"It Don't Mean a Thang if it Ain't Got That Swang"

------------------------------

From: Ilja Booij <[EMAIL PROTECTED]>
Crossposted-To: 
alt.destroy.microsoft,comp.os.ms-windows.advocacy,comp.os.ms-windows.nt.advocacy
Subject: Re: Red hat becoming illegal?
Date: 15 Dec 2000 17:08:14 +0100

"Tom Wilson" <[EMAIL PROTECTED]> writes:

> "Steve Mading" <[EMAIL PROTECTED]> wrote in message
> news:918t6h$qhq$[EMAIL PROTECTED]...
> > In comp.os.linux.advocacy Aaron R. Kulkis <[EMAIL PROTECTED]> wrote:
> >
> > : Yes...the term liberal (root: liber = freedom) has been absconded
> > : with by the freedom-hating socialists.
> >
> > Then why help then mis-use it?  Stop calling them liberals then.
> 
> They get mad when you call them Socialists because it sounds un-American.

Socialists has a bit of nasty taste to it of course.. 
in the Netherlands we have a social-democrat party, i guess that would
be a better term for it.

Ilja


------------------------------

From: Aaron Ginn <[EMAIL PROTECTED]>
Subject: Why use malloc?
Date: 15 Dec 2000 08:36:55 -0700


I admit it's been at least a year or two since I did any significant C 
coding, but I'm looking to get back into it, so I'll ask this
question.

Why would anyone use malloc instead of calloc to allocate memory
dynamically?  From the man page I have in front of me:

==================================================

     The  malloc()  and  free()  functions  provide   a   simple,
     general-purpose  memory  allocation  package.  The  malloc()
     function returns a pointer to  a  block  of  at  least  size
     bytes suitably aligned for any use.

     .
     .
     .

     The calloc() function allocates space for an array of  nelem
     elements of size elsize. The space is initialized to zeros.

==================================================

This indicates that malloc does not zero out the memory block being
allocated for use while calloc does.  Is this correct?  Also, calloc
has the advantage of being able to allocate as many blocks as required 
while malloc is limited to one block per call.

Am I missing something here?  Why would anyone want to use malloc if
it does not zero out the allocated block of memory when calloc does?
Is there a potential, however small, to corrupt data assigned to
that chunk of memory if the memory isn't zeroed out first?  Aren't we
all taught in our first programming class to initialize all our
variables to zero to prevent the minute chance that our data may be
corrupted in some way?

-- 
Aaron J. Ginn                    Phone: 480-814-4463 
Motorola SemiCustom Solutions    Pager: 877-586-2318
1300 N. Alma School Rd.          Fax  : 480-814-4463
Chandler, AZ 85226 M/D CH260     mailto:[EMAIL PROTECTED]

------------------------------

From: [EMAIL PROTECTED] (Donovan Rebbechi)
Crossposted-To: comp.os.ms-windows.advocacy,comp.os.ms-windows.nt.advocacy
Subject: Re: Red hat becoming illegal?
Date: 15 Dec 2000 16:29:54 GMT

On 15 Dec 2000 07:23:01 -0700, Aaron Ginn wrote:
>"Chad Myers" <[EMAIL PROTECTED]> writes:

>So?  Conservatives do it just as much, and for a prime example I
>submit Dubya's slandering of John McCain in South Carolina during the
>primaries.  This was one of the ugliest smear campaigns I've ever
>seen, culminating in running an ad stating that John McCain was
>against breast cancer research since he voted against a bill that had
>a breast cancer issue tacked onto it.  He voted against that bill for

I believe they also slandered McCain on his environmental record, and
they ended up having to pull the offending commercial.



-- 
Donovan Rebbechi * http://pegasus.rutgers.edu/~elflord/ * 
elflord at panix dot com

------------------------------

Date: Fri, 15 Dec 2000 11:37:24 -0500
From: Donn Miller <[EMAIL PROTECTED]>
Subject: Re: I concede (Windows back on my machine)

Aaron Ginn wrote:

> Donn,
> 
> I'll bet there are a lot more people in this group that are in the
> same situation as you, but won't admit it.  I dual-boot, and I'm not
> ashamed to say it.  Linux does some things better for me than Windows,
> and vice versa.  Actually, I don't use Windows at all at work (Solaris
> only), but I still use it at home, because it's good enough for what I
> use it for.  Besides, it came with the PC.  I might as well use it.

Ooo!  That's the opposite scenario I'm in a lot of times:  unix at home,
Windows at work. I try to find a job that has whatever OS I'm most
comfortable with, and that's unix a lot of times.  But a lot of times, a
very good opportunity pops up, and I have to use Windows.  As a Linux
advocate, I'm not happy about that decision.  But, I can psyche myself
up by telling myself it's only software.  But Linux and unix are so much
better than Windows!

In reality, it's almost impossible to live without Windows.  As a rabid
Linux, FreeBSD, and unix advocate, I feel it's important to run these
systems as much as possible.  But, it's OK to reboot into Windows once
in a while.  You just try to minimize Windows usage as a unix advocate. 
BTW, that grub bootloader sure is nifty!  I can even boot Windows Me off
of my second HD with it.  A lot of people bitch about Grub.  I can
understand why.  It's hardly what I'd call user-friendly, but it's a
pretty powerful and flexible boot loader once you know what you're
doing.

> Dude, it's been a pretty sucky second half of the year for you.  First
> Penn State, now this!  Welcome to the world the rest of us inhabit,
> where your college football team doesn't always win at least 9 games a
> year, and you have to use Windows. :)

Thanks Aaron.  In the first half of the season, after losing to USC
(horrible) and Toledo, I didn't think PSU would win one single game! 
But, then came the win over LaTech, and I was thinking 1-11.  Then came
the loss to Pitt!  Gawd, for a Penn Stater, there is no more humiliating
a loss than at the hands of Pitt.  The irony is that I may be working at
Pitt, because I live so close to the University of Pittsburgh.

But, the season didn't turn out so bad.  The win over Purdue sure was
exciting.  We finished 5-7, which was a lot better than I had expected,
given how horribly the season had been going.  Plus, it was kinda
exciting.

I don't feel so bad, because this year PSU's got very decent basketball
team this year.  Plus, PSU beat Pitt in basketball.  Gotta love that! 
It's not exactly football, but it's great to see a school that had been
so traditionally bad in BBal make a turnaround in that sport.

Donn


====== Posted via Newsfeeds.Com, Uncensored Usenet News ======
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
=======  Over 80,000 Newsgroups = 16 Different Servers! ======

------------------------------

From: [EMAIL PROTECTED] (Donovan Rebbechi)
Crossposted-To: 
alt.destroy.microsoft,comp.os.ms-windows.advocacy,comp.os.ms-windows.nt.advocacy
Subject: Re: Red hat becoming illegal?
Date: 15 Dec 2000 16:40:52 GMT

On Fri, 15 Dec 2000 13:30:52 GMT, Chad Myers wrote:
>

>> Yet another GOP violation of States Rights.
>
>Fundamental human decency supercedes all other rights, like the case of

Yet conservatives often cite "states rights" as a reason for not stepping
in. For example, in Australia, homosexuality is *illegal* in one state, 
and the conservatives at a federal level spoke of "states rights". 

>Likewise, slavery could not prevail because it went against one of the
>founding principals of the Declaration of Independence and the Constitution.

Not at all. The authors of the constitution knew of and accepted slavery. 

Therefore it was only against a new (and at that time, somewhat radical)
reinterpretation of the constitution.

That's right, Lincoln went against tradition, radically re-interpreted
the constitution in a way that would make a modern republican cry
("activist judge"), and then based on his radical interpretation, he
pressed this view on the states. I don't see anything "conservative"
about this at all.

>Conservatives are willing to violate States Rights in the favor of upholding
>founding principles of the Constitution. 

Lincoln went beyond this and re-interpreted the constitution.

> Another example is the fundamental
>fairness and equal protection issues in the Florida "Recount".

No, that's an example of "we want to win the election". If the two parties
were on opposite sides of the same circumstances, they would have been 
chanting "states rights!". It's natural to expect each side to do their
best to advance a case that they should win, and I'm not faulting them for
this.

-- 
Donovan Rebbechi * http://pegasus.rutgers.edu/~elflord/ * 
elflord at panix dot com

------------------------------

From: [EMAIL PROTECTED] (Donovan Rebbechi)
Subject: Re: I concede (Windows back on my machine)
Date: 15 Dec 2000 16:45:48 GMT

On 15 Dec 2000 08:07:43 -0600, Donn Miller wrote:
>I previously had been Windows-free on my machine.  However, I am finding it
>very hard to find plentiful jobs that are devoid of Windows/Microsoft.  If
>there were such a world, I'd be all for it.  The best I could do is find a
>jobs that had Windows programming with a little Linux on the side.  So, I
>grudgingly went out to Wal-Mart and got a copy of Windows Me.  My
>MSoft-free days are over, unfortunately.

I just did a search for "C++" on dice.com and most of the matches were 
actually UNIX.

>But, I guess all is not lost.  Companies look at you as being very marketable
>and flexible if you can do both Windows and unix programming/admin.  In an

IMO the smart thing to do is learn languages / skills that aren't tied to
a particular OS. For example, C++ is popular on all platforms. As is
java.

Cheers,
-- 
Donovan Rebbechi * http://pegasus.rutgers.edu/~elflord/ * 
elflord at panix dot com

------------------------------

From: Brian Langenberger <[EMAIL PROTECTED]>
Subject: Re: Why use malloc?
Date: 15 Dec 2000 16:50:22 GMT

Aaron Ginn <[EMAIL PROTECTED]> wrote:

<snip!>

: This indicates that malloc does not zero out the memory block being
: allocated for use while calloc does.  Is this correct?  Also, calloc
: has the advantage of being able to allocate as many blocks as required 
: while malloc is limited to one block per call.

My C is a little rusty, but I recall calloc being primarily for
allocating space for arrays.  The memory allocated is still one
chunk for the purposes of free(), but calloc makes the task
slightly easier.

: Am I missing something here?  Why would anyone want to use malloc if
: it does not zero out the allocated block of memory when calloc does?

Zeroing out the memory takes time (albiet small) that is often
unnecessary.  For string allocation it can be helpful (since
the whole chunk will start as null bytes) but it's somewhat
marginal beyond that.

: Is there a potential, however small, to corrupt data assigned to
: that chunk of memory if the memory isn't zeroed out first?  Aren't we
: all taught in our first programming class to initialize all our
: variables to zero to prevent the minute chance that our data may be
: corrupted in some way?

There shouldn't be any danger of memory corruption unless your
application has some serious casting bugs or array access
errors that need fixing.  Having a cushion of zeroed bytes
won't solve an underlying problem of hopping out of array
boundries, for example.  calloc is just a tool for a different
job rather than an improvement on malloc, I think.


------------------------------

From: [EMAIL PROTECTED] (The Ghost In The Machine)
Crossposted-To: 
comp.os.ms-windows.nt.advocacy,comp.os.ms-windows.advocacy,comp.sys.mac.advocacy,comp.os.os2.advocacy,comp.unix.advocacy
Subject: Re: A Microsoft exodus!
Date: Fri, 15 Dec 2000 17:02:28 GMT

In comp.os.linux.advocacy, [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
 wrote
on Wed, 13 Dec 2000 02:04:17 GMT
<BOAZ5.1596$[EMAIL PROTECTED]>:
>The Ghost In The Machine writes:
>
>>>> So, to sum up:
>>>>
>>>> [1] Nothing is intuitive.
>
>>> You need to consult a manual for everything???
>
>> "Intuitive" doesn't mean "not needing to consult a manual".
>
>You have a better definition that is simple to understand?

How about the one in the manual?  Erm, I mean, dictionary? :-)

   intuitive \In*tu"i*tive\, a. [Cf. F. intuitif.] 1. Seeing clearly; as,
   an intuitive view; intuitive vision.

   2. Knowing, or perceiving, by intuition; capable of knowing without
   deduction or reasoning.

   Whence the soul Reason receives, and reason is her being, Discursive,
   or intuitive. --Milton.

   3. Received. reached, obtained, or perceived, by intuition; as,
   intuitive judgment or knowledge; -- opposed to deductive. --Locke.
   Source: Webster's Revised Unabridged Dictionary, © 1996, 1998 MICRA,
   Inc.

   intuitive adj 1: derived from or prompted by a natural tendency; "an
   intuitive perception"; "visceral revulsion"; "a glandular aversion to
   materialistic values" [syn: visceral, glandular] 2: obtained through
   intuition rather than from reasoning or observation [syn: nonrational]
   Source: WordNet ® 1.6, © 1997 Princeton University

(this from http://www.dictionary.com)

-- 
[EMAIL PROTECTED] -- insert random misquote here
                    up 82 days, 23:03, running Linux.

------------------------------

From: [EMAIL PROTECTED] (The Ghost In The Machine)
Crossposted-To: 
comp.os.ms-windows.nt.advocacy,comp.os.ms-windows.advocacy,comp.sys.mac.advocacy,comp.os.os2.advocacy,comp.unix.advocacy
Subject: Re: A Microsoft exodus!
Date: Fri, 15 Dec 2000 17:06:42 GMT

In comp.os.linux.advocacy, Aaron R. Kulkis
<[EMAIL PROTECTED]>
 wrote
on Wed, 13 Dec 2000 07:25:52 -0500
<[EMAIL PROTECTED]>:
>The Ghost In The Machine wrote:
>> 
>> In comp.os.linux.advocacy, Steve Mading
>> <[EMAIL PROTECTED]>
>>  wrote
>> on 6 Dec 2000 00:07:30 GMT
>> <90k002$ge2$[EMAIL PROTECTED]>:
>> >In comp.os.linux.advocacy [EMAIL PROTECTED] wrote:
>> >
>> >: That's the problem with Aaron's argument.  It can be used to claim that
>> >: nothing is intuitive.  You're quite right to note that intuitiveness is
>> >: not an absolute.
>> >
>> >If you really admitted that intuativeness was not an abosulte, you
>> >would refrain from making such blanket statments as "vi is not
>> >intuative".  If you really believed intuativeness was relative,
>> >then that type of statement would require some qualifiers.
>> >
>> 
>> Vi is not intuitive ... just extremely useful for those who have
>> learned its idiosyncracies.  I for one could say the same about Emacs or
>> even Notepad, Wordpad, Microsoft Word, Corel WordPerfect, or other
>
>Notepad is NOT useful.

Notepad is quite useful, within its many limitations:

- It can't handle newline-only text files.
- It is a monofont editor; the font must be monospaced, as well.
- It doesn't do word wrap; one has to scroll to see long lines.
- It doesn't have regular expressions.  I don't know if it even
  understands wildcards.
- It doesn't have macros/automation.
- It can't be customized except perhaps to change the monospaced font.

But that doesn't mean it's not useful.  Even a rock is useful,
within *its* limitations. :-)

(Of course, there are better tools out there than Notepad.
Wordpad, for one; vi, for another.)

[.sigsnip]

-- 
[EMAIL PROTECTED] -- insert random misquote here
                    up 82 days, 23:06, running Linux.

------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: 
comp.os.ms-windows.nt.advocacy,comp.os.ms-windows.advocacy,comp.sys.mac.advocacy
Subject: Re: A Microsoft exodus!
Date: Fri, 15 Dec 2000 16:58:31 GMT

In article <Wcd_5.232$[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] wrote:

> You're still erroneously presupposing a game on my part, Steve.

Oh, it's definitely a game on your part, Tholen, whether you care to
admit it (to yourself or anyone else) or not.

-- [snip of remaining disrespectful Tholen Crap] --


Curtis


Sent via Deja.com
http://www.deja.com/

------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: 
comp.os.ms-windows.nt.advocacy,comp.os.ms-windows.advocacy,comp.sys.mac.advocacy
Subject: Re: A Microsoft exodus!
Date: Fri, 15 Dec 2000 17:03:31 GMT

In article <rpd_5.234$[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] wrote:
> Steve Mading writes:

-- snip --

> > [rest deleted.  I don't have time for this shit anymore.]
>
> Then why are you bothering to respond at all?

This is actually a legitimate question on Tholen's part; why does
anybody respond to him seriously at all?

I've learned not to do so. He isn't worthy. Anyone who thinks otherwise
is naive.  Tholen will always "win" simply because, as Steve has noted,
Tholen has more free time than anyone else to devote to this nonsense.


Curtis


Sent via Deja.com
http://www.deja.com/

------------------------------

From: Andres Soolo <[EMAIL PROTECTED]>
Subject: Re: Another UNIX sight is doun!
Date: 15 Dec 2000 17:18:24 GMT

Michael Marion <[EMAIL PROTECTED]> wrote:

> I still say it's someone doing a psych study to see how long people will
> continue to argue with someone that's clearly either not serious or simply a
> fool.
Then, the study has failed--he is manifesting his stupidity so clearly
he is clearly just a bait :-)

-- 
Andres Soolo   <[EMAIL PROTECTED]>

Furbling, v.:
        Having to wander through a maze of ropes at an airport or bank
even when you are the only person in line.
                -- Rich Hall, "Sniglets"

------------------------------

From: [EMAIL PROTECTED]
Crossposted-To: 
comp.os.ms-windows.nt.advocacy,comp.os.ms-windows.advocacy,comp.sys.mac.advocacy
Subject: Re: A Microsoft exodus!
Date: Fri, 15 Dec 2000 17:10:22 GMT

In article <RFk_5.438$[EMAIL PROTECTED]>,
  [EMAIL PROTECTED] wrote:
> Tom Wilson writes:

> > I think the point of that exercise is to appease the volcano, and
> > not to piss it off royally.
>
> Yet another person more interested in invectice than a logical
> argument. No surprise there.

Of course not, Tholen; it should come as no surprise since you have
proven time and time again that invective is pretty much all you
deserve, considering your displayed disrespect for your opponents by
ignoring and/or dismissing any logical arguments they present.

(Generally, here is where Tholen would arrogantly ask "What alleged
logical arguments?"  Or words to that effect.)


Curtis


Sent via Deja.com
http://www.deja.com/

------------------------------

From: "Ayende Rahien" <[EMAIL PROTECTED]>
Crossposted-To: 
comp.os.ms-windows.nt.advocacy,comp.os.ms-windows.advocacy,comp.sys.mac.advocacy,comp.os.os2.advocacy,comp.unix.advocacy
Subject: Re: A Microsoft exodus!
Date: Fri, 15 Dec 2000 19:25:08 +0200


"The Ghost In The Machine" <[EMAIL PROTECTED]> wrote in
message news:[EMAIL PROTECTED]...
> In comp.os.linux.advocacy, Aaron R. Kulkis
> <[EMAIL PROTECTED]>
>  wrote
> on Wed, 13 Dec 2000 07:25:52 -0500
> <[EMAIL PROTECTED]>:
> >The Ghost In The Machine wrote:
> >>
> >> In comp.os.linux.advocacy, Steve Mading
> >> <[EMAIL PROTECTED]>
> >>  wrote
> >> on 6 Dec 2000 00:07:30 GMT
> >> <90k002$ge2$[EMAIL PROTECTED]>:
> >> >In comp.os.linux.advocacy [EMAIL PROTECTED] wrote:
> >> >
> >> >: That's the problem with Aaron's argument.  It can be used to claim
that
> >> >: nothing is intuitive.  You're quite right to note that intuitiveness
is
> >> >: not an absolute.
> >> >
> >> >If you really admitted that intuativeness was not an abosulte, you
> >> >would refrain from making such blanket statments as "vi is not
> >> >intuative".  If you really believed intuativeness was relative,
> >> >then that type of statement would require some qualifiers.
> >> >
> >>
> >> Vi is not intuitive ... just extremely useful for those who have
> >> learned its idiosyncracies.  I for one could say the same about Emacs
or
> >> even Notepad, Wordpad, Microsoft Word, Corel WordPerfect, or other
> >
> >Notepad is NOT useful.
>
> Notepad is quite useful, within its many limitations:
>
> - It can't handle newline-only text files

What do you mean newline?
You mean the one used in *nix?
In windows you need two characters for new line.

> - It is a monofont editor; the font must be monospaced, as well.

It is a text editor, not a word processor.

> - It doesn't do word wrap; one has to scroll to see long lines.

It does.

> - It doesn't have regular expressions.  I don't know if it even
>   understands wildcards.

It doesn't.


> - It doesn't have macros/automation.

Of course not.

> - It can't be customized except perhaps to change the monospaced font.

Yep.

> But that doesn't mean it's not useful.  Even a rock is useful,
> within *its* limitations. :-)

Agreed.

> (Of course, there are better tools out there than Notepad.
> Wordpad, for one; vi, for another.)

Notepad is a text editor, and a basic one at that.



------------------------------

Date: Fri, 15 Dec 2000 12:26:38 -0500
From: Gary Hallock <[EMAIL PROTECTED]>
Subject: Re: Why use malloc?

Aaron Ginn wrote:

> I admit it's been at least a year or two since I did any significant C
> coding, but I'm looking to get back into it, so I'll ask this
> question.
>
> Why would anyone use malloc instead of calloc to allocate memory
> dynamically?

Zeroing out memory takes time.   Sometimes you really wany to initialize
to something other than zero, so calloc would be a waste of time.  Also,
some operating systems, such as AIX, overbook memory allocation.    You
can allocate more memory than you have paging space and the memory is
only assigned paging space when referenced.  This can be a big advantage
for sparse arrays.  Of course, you don't get an error due to lack of
paging space until long after the malloc, which can complicate error
handling.

Gary


------------------------------

From: Andres Soolo <[EMAIL PROTECTED]>
Subject: Re: Why use malloc?
Date: 15 Dec 2000 17:30:01 GMT

You might get a better answer from comp.lang.c .

Aaron Ginn <[EMAIL PROTECTED]> wrote:
> This indicates that malloc does not zero out the memory block being
> allocated for use while calloc does.  Is this correct?  Also, calloc
Yes, malloc is not required by the standard to zero the allocated memory.
But then again, zeroing wastes precious time when you really don't need
it.

> has the advantage of being able to allocate as many blocks as required 
> while malloc is limited to one block per call.
This isn't really advantage.  It could be called convenience.
It means that calloc can multiple two numbers to get the block's
length; but when you write the multiplication part in calling malloc()
(like malloc (node_count * sizeof (struct node)) ), the compiler can
optimize the multiplication (by replacing it with shifting, for example).
Which is not possible with calloc().

> Am I missing something here?  Why would anyone want to use malloc if
> it does not zero out the allocated block of memory when calloc does?
Zeroing is not an essential feature.  Time is often more needed than
zeroes.

> all taught in our first programming class to initialize all our
> variables to zero to prevent the minute chance that our data may be
> corrupted in some way?
Well, at least I am not :-)

Contrariwise, that sort of `implicit clearing' might hide serious coding
errors, which is a Bad Thing.

-- 
Andres Soolo   <[EMAIL PROTECTED]>

You!  What PLANET is this!
                -- McCoy, "The City on the Edge of Forever", stardate 3134.0

------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list by posting to comp.os.linux.advocacy.

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Advocacy Digest
******************************

Reply via email to