Re: help a beginner with a basic function that should return a char
- From: Tim Harig <usernet@xxxxxxxxxx>
- Date: Sun, 12 Jul 2009 18:51:03 GMT
On 2009-07-12, Nobody <nobody@xxxxxxxxxxx> wrote:
On Sat, 11 Jul 2009 22:26:00 +0000, Tim Harig wrote:
There are many things that are possible to do with C standards but whichThe usual solution to dlclose() issues is simply not to call dlclose().
are not necessarily great programming practice. I don't think depending
on the duality the behavior of static variables and those in local scope is
such a great idea. I never declare anything static and I don't depend on
the fact that literal strings will be. I always make the simplified
assumption that everything local will be gone when returning and my code
works. If that not what is happening behind the scenes then I have still
lost very little; but, I have potentially avoided problems like dlopen()
without explicity accounting for the possiblility.
Which rather defeats the part of the idea of runtime loadable modules. Do
you think it is less a waste of resources to have blocks of code segments
that are not being used in memory when you could instead offload what you
are not using?
This approach is one of the biggest hurdles to the use of applicationanyone). Literal data belongs in the .rodata segment, or in a file whichI don't often have resource problems on modern machines. When in conflict,
is mmap()d read-only, not on the heap.
I will choose better design and more flexible code over fast code. I can
always, easily and relatively cheaply, add more RAM, more storage, or more
processing power.
I use gettext() as black box. How it implements itself is its own
business. I have never had resource problems because of it.
servers. Applications tend to be written as if each user has the resources
of a desktop PC to themselves. Much of the efficiency which could be
obtained with a shared server is wasted because applications allocate
large amounts of unshared memory in spite of the fact that much of the
data will be common to all instances of a program.
Funny, I have written servers before which had no performance problems and
the world hasn't endeded since I didn't pass any literals from functions.
In fact, my programs are known internally for being extremely small,
simple, and stable.
There are always a few who get off by shaving that extra millisecond.
They spend more time writing their code and the result is usually more
complex leading to worse bugs. Their performance gains are insignificant
compared to the extra salary and benefits costs in the time that they
waste.
I suppose that it is macho to squeeze out those extra resources; but, I
have never been given to attempting to be macho. I prefer simple, solid
code that is good enough performancewise to get the job done in spec.
.
- Follow-Ups:
- Re: help a beginner with a basic function that should return a char
- From: Willem
- Re: help a beginner with a basic function that should return a char
- From: Stephen Sprunk
- Re: help a beginner with a basic function that should return a char
- References:
- help a beginner with a basic function that should return a char
- From: bpascal123@xxxxxxxxxxxxxx
- Re: help a beginner with a basic function that should return a char
- From: Ben Pfaff
- Re: help a beginner with a basic function that should return a char
- From: Beej Jorgensen
- Re: help a beginner with a basic function that should return a char
- From: Ben Pfaff
- Re: help a beginner with a basic function that should return a char
- From: Beej Jorgensen
- Re: help a beginner with a basic function that should return a char
- From: Tim Harig
- Re: help a beginner with a basic function that should return a char
- From: Nobody
- Re: help a beginner with a basic function that should return a char
- From: Tim Harig
- Re: help a beginner with a basic function that should return a char
- From: Nobody
- help a beginner with a basic function that should return a char
- Prev by Date: Re: linking c++ code with c library
- Next by Date: Re: linking c++ code with c library
- Previous by thread: Re: help a beginner with a basic function that should return a char
- Next by thread: Re: help a beginner with a basic function that should return a char
- Index(es):
Relevant Pages
|