Merged
Conversation
fix: oneline compiling for submit
- ESC_KEYの重複定義を削除
Developブランチの変更をrelease/submission-1へマージ
There was a problem hiding this comment.
Pull request overview
This PR refactors memory management and input validation for submission environment compatibility. It fixes memory leak risks, standardizes error handling, and adjusts floating-point tolerance for normalized vector validation.
Changes:
- Hardcoded compilation thread count to 1 for both macOS and Linux to simplify behavior in submission environments
- Refactored
free_sceneto use double pointer pattern, automatically setting pointer to NULL after freeing to prevent use-after-free bugs - Added
NORM_EPSILONconstant (1e-3) for normalized vector validation with better floating-point tolerance - Standardized malloc failure error messages to use
print_error(ERR_MSG_MALLOC)instead ofperror - Removed duplicate ESC_KEY definition from config.h
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Makefile | Hardcoded THREADS to 1 for consistent compilation behavior in submission environment |
| includes/config.h | Added NORM_EPSILON (1e-3) for vector validation; removed duplicate ESC_KEY definition |
| includes/miniRT.h | Updated free_scene signature to accept double pointer |
| srcs/free.c | Refactored free_scene to use double pointer pattern and set pointer to NULL after freeing |
| srcs/parsing/parse.c | Updated free_scene calls to pass address of scene pointer |
| srcs/parsing/object_list.c | Standardized malloc error message from perror to print_error(ERR_MSG_MALLOC) |
| srcs/parsing/validate_values.c | Changed normalized vector validation to use NORM_EPSILON instead of EPSILON |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
メモリ解放処理と入力検証まわりの不具合修正・改善
関連issue
なし
変更点
1に固定し、提出環境向けに挙動を単純化free_scene関数をダブルポインタ対応に変更し、解放後にNULLクリアNORM_EPSILONを追加し、浮動小数誤差を考慮したバリデーションに改善print_error(ERR_MSG_MALLOC)に統一懸念点
NORM_EPSILONの値によっては、シーンによって判定が厳しすぎる / 緩すぎる可能性があるレビュー観点
free_scene周辺)がリークやダブルフリーを起こさないこと