Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!udel!haven!mimsy!mojo!eng.umd.edu!stripes From: stripes@eng.umd.edu (Joshua Osborne) Newsgroups: comp.windows.x Subject: Re: Need opinions re: BadAlloc Message-ID: <1990Dec27.005010.29258@eng.umd.edu> Date: 27 Dec 90 00:50:10 GMT References: <9012220228.AA10299@Larry.McRCIM.McGill.EDU> Sender: news@eng.umd.edu (C-News) Reply-To: stripes@eng.umd.edu (Joshua Osborne) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 32 In article <9012220228.AA10299@Larry.McRCIM.McGill.EDU>, mouse@LARRY.MCRCIM.MCGILL.EDU writes: > > I'm now writing the code which sets the various properties > > WM_COMMAND, WM_CLIENT_MACHINE, etc. required by the ICCCM. I doubt a > > failure to intern these atoms is likely, but am not at all sure how > > to procede if trying to write to them produces a BadAlloc. > > I would not fault an application for simply dying if that happens. > Besides, if the server can't even intern an atom, it is probably going > to be failing right and left when you try to create the rest of your > window tree, pixmaps, and whatnot. It is possable that a server would have a diffrent memmory area for propertys (the MIT server doesn't), for example storing all props in a 64K segment :-( With the growing number of X terminals, and X servers for 80x86 boxes these things are more likely. The best thing is to try to issue an error message an go on. However I too would not fault an application that simply allows the normal error handler to print a message and abort the application. There is also the possability that WM_COMMAND is verry large (>32K, or >64K) and some servers may not support props that large (for the same reasons as above), or that there isn't that much contigus memmory available, but plenty of fragments are available (an Xterminal vender may have assumed that best-fit memmory allocation shoul be used), the application may be able to run normally if it ignores the WM_COMMAND failure... [...] -- stripes@eng.umd.edu "Security for Unix is like Josh_Osborne@Real_World,The Multitasking for MS-DOS" "The dyslexic porgramer" - Kevin Lockwood "Don't over-comment" - p151 The Elements of Programming Style 2nd Edition Kernighan and Plauger