home *** CD-ROM | disk | FTP | other *** search
- From: sfk@otter.hpl.hp.com (Steve Knight)
- Date: Fri, 1 Jan 1993 17:46:32 GMT
- Subject: Re: When the (Gibson) cat's away across the atlantic....
- Message-ID: <116670043@otter.hpl.hp.com>
- Organization: Hewlett-Packard Laboratories, Bristol, UK.
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!col.hp.com!news.dtc.hp.com!hpscit.sc.hp.com!hplextra!otter.hpl.hp.com!otter!sfk
- Newsgroups: comp.lang.pop
- References: <57967@dime.cs.umass.edu>
- Lines: 23
-
- Robin Popplestone writes:
- > Needing to crunch a quarter of a million pixels in a hurry I have been
- > reduced to writing 600 lines of C. How, I wondered to let C report its
- > answers back to POP - these had to be line-segment records as well as
- > an 512*512 array (something like the Ramsay and Barrett line-finder
- > souped up) Now the array was no problem - POP knows how big it will
- > be, and just gives C the array vector. Line segments, the number of
- > which cannot be predicted, presented a harder problem. I didn't want
- > to use a call-back to the POPLOG allocator, for various reasons. So I
- > made POP hand C a large vector, which C then carves into segment
- > records (using a segment-key handed in as an argument) and a left-over
- > vector.
-
- While supporting Robin's request for suitable .h files to make this
- kind of programming safer, I am puzzled by the need for it here.
-
- Why not pre-allocate all the line-segment records and stick them
- into a vector (null-terminated)? This vector can then be passed to
- C with impunity. It is admittedly slightly more space consuming
- and likely to take more slightly time to preallocate. But this
- seems like quite an acceptable cost to me.
-
- Steve
-