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

[Feature Request] Max possible pool size given json length #38

Closed
lshamis opened this issue Sep 6, 2021 · 1 comment
Closed

[Feature Request] Max possible pool size given json length #38

lshamis opened this issue Sep 6, 2021 · 1 comment

Comments

@lshamis
Copy link
Contributor

lshamis commented Sep 6, 2021

Given the length of a json string, what is the upper bound on the size of a pool alc that could handle that json?

    size_t pool_size;
    yyjson_alc_pool_max_size(json_size, &pool_size);

    void *buf = alloca(pool_size)
    yyjson_alc alc;
    yyjson_alc_pool_init(&alc, buf, pool_size);
@lshamis
Copy link
Contributor Author

lshamis commented Sep 6, 2021

Nevermind, this exists as yyjson_read_max_memory_usage

@lshamis lshamis closed this as completed Sep 6, 2021
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

No branches or pull requests

1 participant