home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!sdd.hp.com!swrinde!news.dell.com!natinst.com!natinst.com!not-for-mail
- From: stepan@natinst.com (Stepan Riha)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: EditText items larger than 255 bytes?
- Message-ID: <18oe6rINN6sm@falcon.natinst.com>
- Date: 10 Sep 92 21:20:27 GMT
- References: <BuAyG1.8n7@iat.holonet.net> <2AAE73AE.49F@intercon.com> <1992Sep10.200136.18513@tamsun.tamu.edu>
- Organization: National Instruments, Austin, TX
- Lines: 29
- NNTP-Posting-Host: falcon.natinst.com
-
- In article <1992Sep10.200136.18513@tamsun.tamu.edu> bpb9204@tamsun.tamu.edu (Brent) writes:
-
- [how to get more than 255 chars out of a dialog text item deleted]
-
- >Now I have a question. When you make a new TERecord, it is 32k in size,
- >right?
- >
- >If you have a modal dialog box with 4 text areas, that's automatically
- >128k of RAM sucked up for 4x255 = 1020 bytes for actualy data (retrieved or
- >set via the SetIText/GetIText calls. If you used the MacOS calls to
- >the letter, that's a 1020/128k percent utilization... pretty awful.
- >
- >Hey, Apple! How about creating a new TextEdit interface so that we can
- >specify the buffer size to use -- as large or small as we need?
- >
- >-Brent
-
- When you make a new TERecord you only allocate memory for a TERec which is
- initially a little over 100 bytes large. The actual text is stored in a handle
- that grows according to how much text you have.
- So if your (one-line) text contains 10 characters you'll use about 130 bytes
- which is less than a Str255. If you actually have 255 characters in your
- item, you'll need about 43% more memory than if items used Str255; with 10
- characters you actually save about 50%.
-
- Of course there is the overhead for two handles but that's quite negligible.
-
- --
- Stepan Riha -- stepan@natinst.com
-