Changed reference binding to value copy for token variables in GetGeomSubsets and GetGeomSubsetChildren functions. This fixes compilation errors with GCC 14 which treats dangling reference warnings (-Wdangling-reference) as errors when using -Werror.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Type-erased container supporting up to 256 types via custom TypeTraits
- 24-byte small buffer optimization for stack allocation
- Automatic heap allocation for large types
- No C++ exceptions or RTTI required
- C++14 compatible implementation
- 32 bytes total overhead per instance
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implement configurable memory limits to prevent out-of-memory conditions when
parsing large USD files. Memory usage is tracked during parsing and loading
fails gracefully when limits are exceeded.
USDC Parser:
- Add memory tracking via CHECK_MEMORY_USAGE/REDUCE_MEMORY_USAGE macros
- Track allocations in crate-reader.cc for tokens, arrays, and data structures
- Pass memory limit from USDLoadOptions through USDCReaderConfig
- Initialize _memoryUsage in CrateReader constructor
USDA Parser:
- Add max_memory_limit_in_mb to USDAReaderConfig (default 16GB)
- Add memory tracking members to AsciiParser class (default 128GB)
- Implement SetMaxMemoryLimit() method in AsciiParser
- Track allocations for arrays, references, and string data
- Add CHECK_MEMORY_USAGE calls in push_back operations
Both parsers now:
- Respect USDLoadOptions::max_memory_limit_in_mb setting
- Provide clear error messages showing limit and current usage
- Fail gracefully before system runs out of memory
Testing:
- Verified with suzanne-subd-lv5.usdc/usda at various limits (10MB, 50MB, 500MB)
- Small files load successfully with 1MB limit
- Memory limits properly enforced at different parsing stages
This feature is especially useful for:
- Mobile/embedded devices with limited memory
- Server environments with resource quotas
- Preventing DoS from malicious/corrupted USD files
- Debugging memory usage patterns in USD files