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

Make buffer_length dynamic #26

Closed
wants to merge 4 commits into from

Conversation

longemen3000
Copy link
Contributor

this allows resizing the buffer on the REPL. it is needed, for calling get_fluid_param_string("Water,"JSON") without erroring.

@barche
Copy link
Collaborator

barche commented Sep 14, 2023

Actually, I don't understand why buffer_length and message_buffer need to be globals, this would cause trouble if this is used from multiple threads.

@ibell
Copy link
Contributor

ibell commented Sep 14, 2023 via email

@longemen3000
Copy link
Contributor Author

longemen3000 commented Sep 24, 2023

i did a check on all fluids currently present on CoolProp, and the longest is Ammonia with a required buffer length of 30916. making it 32768 (2^15) to allow some leeway, but i suppose the JSON of a fluid is the longest possible string that CoolProp could return

@barche barche mentioned this pull request Sep 24, 2023
@barche
Copy link
Collaborator

barche commented Sep 24, 2023

I made a copy at PR #34 since I failed to modify this one, some of the calls to length needed to be replaced with Base.length because length was also in the function argument list and took precedence.

@barche barche closed this Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants