Bob Cowling (cowling++at++autometric.com)
Mon, 13 Jul 1998 09:49:52 -0400
Here's what you probably want (move the parentheses)
striplengths=(int *)(pfMalloc((height-1)*sizeof(int),
pfGetSharedArena()));
What you had was allocating memory from the heap, but
the real problem arose because the compiler was placing
the shared arena in striplengths, which you were then setting
the vtable and hidden members to be 2*width.
The new compiler now warns about the line by saying
warning(1171): expression has no effect
Tagore D. Smith wrote:
>
> I hope that this isn't too trivial for the list, but I have been having
> some trouble allocating memory. What I am doing seems to me like it should
> work, and in fact elsewhere in the program I am using identical syntax
> with no problems.
>
> I am trying to create a non-indexed geoset made up of triangle strips.
> The pointer to the array holding the striplengths is a member variable of
> my main application class, which is declared globally, before pfInit(),
> etc. . I allocate the memory like this:
>
> striplengths=(int *)(pfMalloc((height-1)*sizeof(int)),
> pfGetSharedArena());
>
--
Robert Cowling (703) 923-4035
Director, Engineering Advanced Visualization & Integration
Autometric, Inc. rcowling++at++autometric.com
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:57:41 PDT