-
Notifications
You must be signed in to change notification settings - Fork 977
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
[API BREAK] Introduce explicit contexts #208
Conversation
I looked at the changes to the main header file and they look good. I would be tempted to remove the |
Need to worry about some combinatorial blowup, e.g. with each mixture of starting options having a new entry point. (We may have more options in the future). Otherwise I'd be agreeing with that. |
@gmaxwell I'm not sure whether you're in favor or against the flags argument... |
For flags. Because if you have six flags or wahtever you might need 2^6 (or more) entriy points otherwise) |
You just need one |
Hm. Doesn't address the case where it's cheaper to initilize a&&b than a, b or where b means you throw out what A does, without having a weird interface where some interact and some don't and some are slower unless you combine them. Now I don't know what I prefer. I know I don't want separate contexts. Since state can potentially be shared (esp in low-mem builds). |
Yeah, so that would be a good reason to keep the |
I think the API for creation/initialization could be simplified to just two functions: secp256k1_context* secp256k1_context_create();
void secp256k1_context_initialize(secp256k1_context* ctx, int flags); // can call multiple times This allows special optimizations of the initialization process, regardless of when the initialization is performed, without combinatorial blowup of entry points. It makes the API simpler because there would be fewer functions and only one way to enable a feature. (Sorry if I'm missing something and this is just another lame idea for some reason!) |
So there's a follow-up plan which is probably not obvious here, namely that some initializations may gain parameters (specifically: the size of the tables), which you probably can't encode as just flags. The explicit initialization functions can then serve as 'advanced' versions, while the flagged create_context does defaulty things. |
Rebased. |
And rebased again. |
Removed the per-feature initialization functions for now. |
Rebased. |
@gmaxwell Review plz? puppy eyes |
Okay, I think I've run out of nits. |
Nits addressed. |
Would be nice to brace that IF; either way: ACK. |
a9b6595 [API BREAK] Introduce explicit contexts (Pieter Wuille)
No description provided.