Closed Bug 107051 Opened 23 years ago Closed 11 years ago

nsNetUtil.h should be made into a static library

Categories

(Core :: Networking, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 170983

People

(Reporter: darin.moz, Unassigned)

Details

(Keywords: perf)

nsNetUtil.h should be made into a static library.  for one thing, this would
allow us to cache necko services (such as the IO service) on behave of each
module that uses necko.
Status: NEW → ASSIGNED
Keywords: perf
Priority: -- → P3
Target Milestone: --- → mozilla0.9.8
But then we lose the benefits of inlining (which are probably very small for
most of these functions, I'll admit). Isn't there a better way to do this? I
don't think we all really want a million little static libraries, one for each
module.

Won't a static variable in a static inline routine be shared between stuff which
is linked together, anyway, but not between stuff which is dlopened? ie can't we
make do_GetIOService do something like: (error checking omitted)

static inline nsIIOService* do_GetIOService() {
static nsIIOService* io = nsnull;
if (!io) {
   io = do_GetService(cid);
}return io;
}

and have this Just Work? Or does this require linker magic which isn't guarenteed?
this would work, but i also wanted to add and xpcom-shutdown observer to free
the io service.  so, i figured a library might be the best way to go.
unlikely to make it for mozilla1.0

-> future
Target Milestone: mozilla0.9.8 → Future
-> default owner
Assignee: darin → nobody
Status: ASSIGNED → NEW
QA Contact: benc → networking
Target Milestone: Future → ---
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.