Closed
Bug 94569
Opened 24 years ago
Closed 23 years ago
[xlib] Move Xlib and Xprint over to new xxlibrgb* API
Categories
(Core :: XUL, enhancement)
Tracking
()
RESOLVED
FIXED
mozilla0.9.4
People
(Reporter: roland.mainz, Assigned: roland.mainz)
References
Details
(Keywords: crash, memory-footprint, perf, Whiteboard: want for mozilla 0.9.4)
Attachments
(7 files)
18.23 KB,
patch
|
Details | Diff | Splinter Review | |
71.17 KB,
patch
|
Details | Diff | Splinter Review | |
71.84 KB,
patch
|
Details | Diff | Splinter Review | |
72.48 KB,
patch
|
Details | Diff | Splinter Review | |
82.24 KB,
patch
|
Details | Diff | Splinter Review | |
80.69 KB,
patch
|
Details | Diff | Splinter Review | |
82.92 KB,
patch
|
Details | Diff | Splinter Review |
Starting with the patches in bug 85527 ("Turn xlibrgb into a shared library") a
new API for xlibrgb.so was introduced to allow more than one |Display *| /
|Screen *| / |Visual *| per process...
... 2nd part is now to make use of that API. Patch follows...
Assignee | ||
Comment 1•24 years ago
|
||
Accepting bug.
Assignee | ||
Comment 2•24 years ago
|
||
Assignee | ||
Comment 3•24 years ago
|
||
Filed patch.
Requesting r=/sr=
Comment 4•24 years ago
|
||
Looks good to me.
r=mkaply on the non makefile changes
Assignee | ||
Comment 5•24 years ago
|
||
cls:
Wanna r= the Makefile.in changes, please ?
Assignee | ||
Comment 7•24 years ago
|
||
Requesting sr= ...
Comment 8•24 years ago
|
||
This patch is unacceptable. If you're going to make multiple handles do it the
right way. Make the handle an argument to the functions that are called and
don't just create more than one static handle in the .c function.
Assignee | ||
Comment 9•24 years ago
|
||
Blizzard:
Did you read bug 85527 ? I am planning to implement that exactly in the same
manner as you've suggested it here in a later patch. This is only the step "move
Xlib/Xprint to new API". The next step is to kill that macro wrappers and global
handles in xlibrgb.so (but first I want to "land" the MIT-SHM support and I need
this one "in" CVS first) ...
Again... requesting sr=, please ...
Assignee | ||
Comment 10•24 years ago
|
||
Quick look at the final solution... such a patch would patch more than 22
files... this won't make it in 0.9.4 as it tooks far too much time for getting
r=/sr= ... I need this one first as a temporary solution to test whether the
"switch" to the new API really does not break anything...
Assignee | ||
Comment 11•24 years ago
|
||
blizzard:
Do you really demand on the final solution ?
Assignee | ||
Comment 12•24 years ago
|
||
Assignee | ||
Comment 13•24 years ago
|
||
Filed all-in-one patch which switches all source files (except Motif port) to
new xxlib_rgb API. This patch includes a new API which allows to "register"
|XlibRgbHandle|s via name - and look-up them later using that name...
Requesting r=/sr= ...
Assignee | ||
Comment 14•24 years ago
|
||
Assignee | ||
Comment 15•24 years ago
|
||
Comment 16•24 years ago
|
||
Yeah, this looks mostly right, don't see anything really out of the ordinary,
but don't know the code that well either. Kinda r=jag, but I would appreciate an
r= or sr= from someone more familiar with this part of Mozilla. Blizzard, would
your sr= validate my r= or would you prefer a second r=?
Comment 17•24 years ago
|
||
+ redScale = 8-xxlib_get_prec_from_mask(visual->red_mask);
Can you put some space in there?
+ redFill = 0xff>>xxlib_get_prec_from_mask(visual->red_mask);
And comment that?
+
+ xxlib_deregister_handle_by_handle(handle);
+ free((void *)handle->name);
and in xxlib_deregister_handle_by_handle():
+ free((void *)registered_handles[i].name);
That's a double free.
Looking at xxlib_register_handle the ownership seems kind of strange. It's
allocated by the caller but is freed by the library? In fact, looking at the
code it looks like there's no clean strategy for who owns what in the library
calls. Please make it consistent.
+/* saves #include "xlibrgb.h" */
+typedef struct _XlibRgbHandle XlibRgbHandle;
+
No, include it. I don't like "extern" type defines.
Assignee | ||
Comment 18•24 years ago
|
||
> + redScale = 8-xxlib_get_prec_from_mask(visual->red_mask);
>
> Can you put some space in there?
Will be fixed.
> + redFill = 0xff>>xxlib_get_prec_from_mask(visual->red_mask);
>
> And comment that?
My change(=[a]) or what the code does(=[b]) ?
a) Swicthed over to new xxlib API... the |handle| argument wasn't used in code,
therefore I removed it.
b) No clue... some bit stunts. I didn't write it... ;-(
> + xxlib_deregister_handle_by_handle(handle);
> + free((void *)handle->name);
>
> and in xxlib_deregister_handle_by_handle():
>
> + free((void *)registered_handles[i].name);
>
> That's a double free.
Nope. First is a XlibRgbHandle-|handle|, 2nd is a |name| in the registry...
I removed the name string from XlibRgbHandle because it wasn't used anymore (I
used it as an arguement to xxlib_deregister_handle(), but I added the ability to
register one XlibRgbHandle with multiple names (aliases) and switched
xxlib_rgb_destroy_handle() over to xxlib_deregister_handle_by_handle() instead).
> Looking at xxlib_register_handle the ownership seems kind of strange. It's
> allocated by the caller but is freed by the library? In fact, looking at the
> code it looks like there's no clean strategy for who owns what in the library
> calls. Please make it consistent.
Oh, yes. bad. See new code. xxlib_register_handle() is only public to allow
users to register a handle more than once or if the handle wasn't registered yet
(e.g. NULL-|name| argument to xxlib_rgb_create_handle() ...
> +/* saves #include "xlibrgb.h" */
> +typedef struct _XlibRgbHandle XlibRgbHandle;
> +
>
> No, include it. I don't like "extern" type defines.
Will be fixed.
New patch follows.
Assignee | ||
Comment 19•24 years ago
|
||
Assignee | ||
Comment 20•24 years ago
|
||
Requesting sr= ...
Assignee | ||
Comment 21•24 years ago
|
||
Assignee | ||
Comment 22•24 years ago
|
||
Filed new patch for 2001-08-15-08-trunk.
This new patch removes two backup files created Nedit and removes unused code
(which was not commented out via |#ifdef| anyway).
The only new thing is nsXPrintContext.cpp:
-- snip --
+ /* workaround for crash in XCloseDisplay() on Solaris 2.7 Xserver - when
+ * shared memory transport is used XCloseDisplay() tries to free() the
+ * shared memory segment - causing heap corruption and/or SEGV.
+ */
+ putenv("XSUNTRANSPORT=xxx");
-- snip --
Assuming that that minor change does not require a new r= ...
... requesting sr= for the new patch, please.
Comment 23•23 years ago
|
||
With the fix of a minor nit in indenting I mentioned on irc, and if you only
made the changes listed above, r=jag, with the same "needs second r="
requirement.
Assignee | ||
Comment 24•23 years ago
|
||
I already fixed all (of blizzard's) issues listed "above".
Looking for 2nd r=, final patch follows after that (incl. that whitespace nit
and fixes for any issues from 2nd review...) ...
Comment 25•23 years ago
|
||
Patch looks ok r=Tomi.Leppikangas@oulu.fi
Assignee | ||
Comment 26•23 years ago
|
||
Assignee | ||
Comment 27•23 years ago
|
||
Filed (hopefully :-) final patch, r=jag, r=cls (for Makefile.in stuff) and
r=Tomi.Leppikangas@oulu.fi
Requesting sr=
Keywords: mozilla0.9.4
Whiteboard: want for mozilla 0.9.4
Comment 28•23 years ago
|
||
Roland says he addressed all of blizzard's concerns, and patch looks ok to me
... sr=kin@netscape.com, unless there are any objections from blizzard.
Comment 29•23 years ago
|
||
May God have mercy on us all. The 212 bug spam-o-rama is Now!
QA Contact: aegis → jrgm
Assignee | ||
Comment 30•23 years ago
|
||
Requesting a=drivers ...
Assignee | ||
Comment 31•23 years ago
|
||
CC:'ing asa - requesting a= ...
Comment 32•23 years ago
|
||
a=asa on behalf of drivers.
Comment 33•23 years ago
|
||
I'll commit this today when I do 94243.
Comment 34•23 years ago
|
||
Fix checked in for gisburn
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•