Project Restructure and Exception Handling
Release 0.7.8
Resolution for issues
Issue #23
- Add
STPSmartDeviceMemoryinSuperTerrain+Utility. Replace all memory that are previously freed manually withcudaFree()with the new smart device memory. - Move pointer assignment to
STPSmartDeviceMemoryto right aftercudaMalloc(), if memory allocation fails no free is required, or if future operation throws an exception the memory will be freed automatically. - Implement
std::unique_ptrfornvrtcProgram,CUmoduleandCUlinkStateinSTPDiversityGeneratorRTC, and replace all occurences with managed memory. - Improve exception handling in
STPChunkProvider. All exceptions from async compute threads are captured into an exception queue and will be merged together and rethrow toSTPChunkManager. - Remove try-catch blocks in
STPHeightfieldGenerator,STPFreeSlipGeneratorandSTPFreeSlipTextureBuffer. Usestd::unique_ptrwith custom deleter to recycle memory so no memory leak is introduced when exception is thrown.
Issue #24
Files that were in CoreInterface are now moved into a newly created folder CoreInterface/SuperTerrain+. This is a more standard way of serving libraries to allow user to distinguishing between a mixture of different libraries and avoid include name collision.
Change in include directory structure has been addressed in all sources and headers.
- Simplify
STPDeviceErrorHandler. Remove error severity switch due to its unnecessity. It now throws exception by default and un-caught exception or exception thrown in the dtor will simply terminate the program. - Change setting macro for
STPDeviceErrorHandlerfromSTP_SUPPRESS_MESSAGEtoSTP_DEVICE_ERROR_SUPPRESS_CERR. This will prevent error handler from writing exception message tostd::cerrstream.
General fixes and improvement
- Replace the following external libraries with imported package, and remove them from the External diectory:
- SglToolkit
- Simplify template instantiation model in
STPMemoryPool. - Remove
usingand unnecessary include fromSTPFreeSlipManager.inl. - Declare
STPEngineInitialiserasfinal.