Re: Over-zealous code re-use

New Message Reply Date view Thread view Subject view Author view

Robert Grzeszczuk (rg)
Tue, 22 Jun 1999 15:03:09 -0700 (PDT)


Angus,

Sorry, let me try again.

Several demos in the Volumizer 1.1 distribution link in an unnecessary object
file. For example, voglCache demo has the following dependency line in the
Makefile:

voglCache_OBJS = $(COMMON_OBJS) \
  voglInitAppearance.o voglInitGeometry.o voglInitTransient.o voglInitGfx.o \
  voglCache.o
voglCache: $(voglCache_OBJS)
        $(CC) -o $@ $(voglCache_OBJS) $(LDFLAGS) $(LLDLIBS)

The object voglInitTransient.o contains code that allocates transient geometry
(my_Data.aPolygonSetArray, which holds sampling polygons resulting from
polygonization) inside of my_InitTransient(). This data can be later released
with a call to my_Cleanup(). This is essenatial for many demos (e.g.,
voglBasic) that rely on this allocation.

However, voglCache (and a few others listed in the previous message) creates an
instance of voDrawActionCache, which internally allocates its own transient
geometry buffer. Calling my_InitTransient() will have no effect
(voGeometryActions::drawUtility() never uses any external transient data
buffers) other than wasting a big chunk of heap memory. Therefore, you are
best off checking that your code does not explicitly allocate voIndexedfaceSets
*and* voDrawActionCaches in the same program. The standard demos will be fixed
with a patch.

Better? :-)

-rg

On Jun 22, 5:49pm, Angus Bond wrote:
> Subject: Re: Over-zealous code re-use
> Robert,
>
...
>
> Would you please rephrase your message and correct the
> grammar so that we may all understand what you are saying?
>
> Thank you very much,
> Angus
>


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Nov 01 1999 - 14:02:50 PST