I'm currently writing a R package for Delaunay and Voronoï tessellations in 3D. Most of the implementation is done in C (with the help of the Qhull library).
While running the Delaunay triangulation on a large number of points (> 10000), I received this error:
Error: protect(): protection stack overflow
In my C code, I run UNPROTECT at the end of the functions, only one time. I'm wondering: if I split the code in blocks, to run UNPROTECT multiple times instead of one time (e.g. each time I reach 1000 PROTECT), could it change something? Is there a known limit for the number of protections?