Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upMake Fragment::debug_id only claim space in debug mode #87
Comments
|
Blocked by: #420 |
|
Update: #420 has been closed |
|
This number is currently stored in Fragment::debug_id. This could be fixed by changing this field's type from The new type will need to implement the Display trait. In non-debug builds, it could display as an empty string, or maybe as its own address. |
|
I bet I can take care of this |
|
I'm not sure what we want to return from At the same time, I feel like |
|
You could change debug_id() to return a DebugId instead of u16. |
|
Hmm, that will just defer the I'd resolution, but I think I've got some ideas. Memory address sounds good, too |
Fragment debug_id u16 only exists in debug, prod will format mem address <!-- Please describe your changes on the following line: --> Each fragment has a `u16` `debug_id` in debug mode, but no `debug_id` in production to save memory. To format a debug id in production, the address of the empty `debug_id` is displayed. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #87 (github issue number if applicable). <!-- Either: --> - [X] These changes do not require tests because it looks like it's not possible to mock out `cfg` options in `#[test]`s <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11442) <!-- Reviewable:end -->
Fragment debug_id u16 only exists in debug, prod will format mem address <!-- Please describe your changes on the following line: --> Each fragment has a `u16` `debug_id` in debug mode, but no `debug_id` in production to save memory. To format a debug id in production, the address of the empty `debug_id` is displayed. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #87 (github issue number if applicable). <!-- Either: --> - [X] These changes do not require tests because it looks like it's not possible to mock out `cfg` options in `#[test]`s <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11442) <!-- Reviewable:end -->
Fragment debug_id u16 only exists in debug, prod will format mem address <!-- Please describe your changes on the following line: --> Each fragment has a `u16` `debug_id` in debug mode, but no `debug_id` in production to save memory. To format a debug id in production, the address of the empty `debug_id` is displayed. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #87 (github issue number if applicable). <!-- Either: --> - [X] These changes do not require tests because it looks like it's not possible to mock out `cfg` options in `#[test]`s <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11442) <!-- Reviewable:end -->
For debugging purposes, all flows/boxes are stamped with an int, to make debugging output readable. Somehow, we should only include this field for debug builds. (well, once there is more than one build mode...)