Re: XForms: xyplot limit

T.C. Zhao (tc_zhao@yahoo.com)
Sat, 22 Aug 1998 22:29:53 -0700 (PDT)

# To subscribers of the xforms list from "T.C. Zhao" <tc_zhao@yahoo.com> :

Thanks for investigating the problem. Yes, XDrawLines()
does have a limit if the server does not support
ExtendedRequestSize. I'll fix xyplot to automatically
break up big request.

---moini@eleceng.adelaide.edu.au wrote:
>
> # To subscribers of the xforms list from
moini@eleceng.adelaide.edu.au :
>
> I dug up the guts of Xlib source (X11R6.4). Here is what I found.
There are
> clear signs of 65535!!!, so it seems that it may also be the npoints
that
> is punished, if "dpy->bigreq_siz" is not set.
>
> Cheers
> Ali
>
> ---------------------------------------------------------
> /* $TOG: Xlibint.h /main/116 1998/02/06 18:02:35 kaleb $ */
> /* $TOG: XlibInt.c /main/116 1998/02/06 18:02:35 kaleb $ */
>
> XDrawLines (dpy, d, gc, points, npoints, mode)
> register Display *dpy;
> Drawable d;
> GC gc;
> XPoint *points;
> int npoints;
> int mode;
> {
> register xPolyLineReq *req;
> register long length;
> LockDisplay(dpy);
> FlushGC(dpy, gc);
> GetReq (PolyLine, req);
> req->drawable = d;
> req->gc = gc->gid;
> req->coordMode = mode;
> SetReqLen(req, npoints, 65535 - req->length);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> /* each point is 2 16-bit integers */
> length = npoints << 2; /* watch out for macros... */
> Data16 (dpy, (short *) points, length);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> UnlockDisplay(dpy);
> SyncHandle();
> return 1;
> }
> ---------------------------------------------------------
> #define SetReqLen(req,n,badlen) \
> if ((req->length + n) > (unsigned)65535) { \
> if (dpy->bigreq_size) { \
> MakeBigReq(req,n) \
> } else { \
> n = badlen; \
> req->length += n; \
> } \
> } else \
> req->length += n
> ---------------------------------------------------------
> #ifdef WORD64
> #define Data16(dpy, data, len) _XData16(dpy, (short *)data, len)
> #else
> #define Data16(dpy, data, len) Data((dpy), (char *)(data), (len))
> ---------------------------------------------------------
> void Data (dpy, data, len)
> Display *dpy;
> char *data;
> long len;
> {
> if (dpy->bufptr + (len) <= dpy->bufmax) {
> memcpy(dpy->bufptr, data, (int)len);
> dpy->bufptr += ((len) + 3) & ~3;
> } else {
> _XSend(dpy, data, len);
> }
> }
>
> #define PACKBUFFERSIZE 4096
> _XData16 (dpy, data, len)
> Display *dpy;
> short *data;
> unsigned len;
> {
> char packbuffer[PACKBUFFERSIZE];
> unsigned nunits = PACKBUFFERSIZE >> 1;
>
> for (; len > PACKBUFFERSIZE; len -= PACKBUFFERSIZE, data +=
nunits) {
> doData16 (dpy, data, PACKBUFFERSIZE, packbuffer);
> }
> if (len) doData16 (dpy, data, len, packbuffer);
> }
> ---------------------------------------------------------
> _________________________________________________
> To unsubscribe, send the message "unsubscribe" to
> xforms-request@bob.usuf2.usuhs.mil or see
> http://bob.usuf2.usuhs.mil/mailserv/xforms.html
> XForms Home Page: http://bragg.phys.uwm.edu/xforms
> List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/
>
>

_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at /cgi-bin/exit-to?http://mail.yahoo.com

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/