Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement replace regex using boost #6213

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from

Conversation

JordanHendersonMusic
Copy link
Contributor

@JordanHendersonMusic JordanHendersonMusic commented Feb 13, 2024

Purpose and Motivation

https://scsynth.org/t/testing-a-draft-of-replaceregexp

Types of changes

  • Documentation
  • New feature

To-do list

  • Code is tested
  • All tests are passing
  • Updated documentation
  • This PR is ready for review

@JordanHendersonMusic
Copy link
Contributor Author

JordanHendersonMusic commented Feb 13, 2024

Does anyone know if the object previously at the return slot needs to be free'd manually gc?

Edit: no it doesn't

@smoge
Copy link
Contributor

smoge commented Feb 13, 2024

I would guess not because of GC. But I have a question. When the code runs into a problem, like receiving the wrong type of data or encountering an issue while processing a regular expression, is SetNil(slot_this) enough? if some data to return but then hits a snag, does the cleanup system still works without manually deallocating output_string? In other words, was it assigned to a slot for GC to manage?

(This is not a review, but just a question)

@JordanHendersonMusic
Copy link
Contributor Author

I would guess not because of GC. But I have a question. When the code runs into a problem, like receiving the wrong type of data or encountering an issue while processing a regular expression, is SetNil(slot_this) enough? if some data to return but then hits a snag, does the cleanup system still works without manually deallocating output_string? In other words, was it assigned to a slot for GC to manage?

(This is not a review, but just a question)

I have no idea... just copied to conventions in the other primitives 🙂

@JordanHendersonMusic
Copy link
Contributor Author

JordanHendersonMusic commented Mar 15, 2024

Coming back to this after learning more... in his case no it doesn't because there isn't any point of failure between creating the string and assigning it to a slot, but in general yes. It is quite common to push any temporary variables onto the end of the stack for this reason.

@JordanHendersonMusic
Copy link
Contributor Author

I've updated this now with tests and documentation.

@JordanHendersonMusic JordanHendersonMusic added the comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library" label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants