Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!ncar!ico!auto-trol!marbru From: marbru@auto-trol.UUCP (Martin Brunecky) Newsgroups: comp.windows.x.motif Subject: Re: XmLabel question Message-ID: <808@auto-trol.UUCP> Date: 4 Sep 90 18:57:12 GMT References: <118526@linus.mitre.org> <141712@sun.Eng.Sun.COM> <5875@hplabsz.HPL.HP.COM> Reply-To: marbru@auto-trol.UUCP (Martin Brunecky) Organization: Auto-trol Technology, Denver Lines: 38 In article <5875@hplabsz.HPL.HP.COM> mayer@hplabs.hp.com (Niels Mayer) writes: >In article <141712@sun.Eng.Sun.COM> argv@turnpike.Eng.Sun.COM (Dan Heller) writes: >> >>Footnote: Probably a good enhancement for Motif 1.1.1 would be a routine >>that created and returned a pointer to a compound string that was stored >>in static space. ... > >This has been my feeling about the Xtoolkit in general, and the problem >becomes ridiculous with compound strings. Such memory usage could be done >in a number of places throughout Motif. There's more than just compound >strings that get gratuitously copied and freed every time you do anything. > >I'd like to even go so far as to have the Toolkit not create a copy of >every resource passed in from the user's space; rather, it should take the >user's object, and do whatever the hell it pleases with it, freeing it when >it is done with it (unless it was statically allocated). ... I remeber seeing something like "useInPlace" resource in some widget. Basically, a widget writer should THINK about copying resources, and be reasonable about it. Unfortunatelly, many C programmers, mislead by the K&R book, consider alloc/free a "noop". Often, a resource value can be described as readonly,static to the application (if someone changes such value dynamically, he gets what he desrves). For example, if you are using the X resource database, most values (strings, for example), are already cached in memory. Copying them into yet another place is plainly ridiculous. But this has nothing to do with Xt. Purely widget writer issue. When we get back to Xt, I'd like to see support for bit fields instead of Boolean. Most widget instances contain between 10 to 30 Booleans ... -- =*= Opinions presented here are solely of my own and not those of Auto-trol =*= Martin Brunecky marbru@auto-trol.COM (303) 252-2499 {...}ncar!ico!auto-trol!marbru Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404