devonmpowell / r3d

Fast, robust polyhedral intersections, analytic integration, and conservative voxelization.
36 stars 18 forks source link

Dynamic vs static allocation #21

Open devonmpowell opened 3 years ago

devonmpowell commented 3 years ago

@ibaned @shevitz @raovgarimella @MackKenamond I am opening this for a new discussion thread.

I pulled Rao's work on the dynamically allocated buffer. But given all the discussion around a smart build system, would it make sense to have CMake control not only the value of R3D_MAX_VERTS, but also whether the code uses static vs dynamic allocation? We could make the API consistent for both cases, so that one could switch at will (i.e., r3d_init_poly() would really do nothing in the static case, but could be left in for consistency)

ibaned commented 3 years ago

If the language were C++, that could be controlled by template parameters as well. Not saying that's the best idea, depends on everyone's willingness to use C++.

raovgarimella commented 3 years ago

That would take some work (for which I don't have time right now). Unless others see a need for actually having this be a thing, I am fine with letting it die. It was an instructive experiment.