Skip to content

Don't use implicit context for core implementation of the interface #71

Open
@Ed94

Description

Currently this global context ptr is tracked by the library in interfaces.hpp & static_data.cpp:

GEN_API extern Context* _ctx;

Eventually this library should opt out of tracking implicit context for baseline implementation
This would automatically make it viable for multi-threaded purposes among other things
An implicit context interface will be provided instead as wrapper procedures as convenience.

Example:

GEN_API CodeBody  parse_global_body(Context* ctx, Str body_def);

Would be the baseline interface and the wrap would simply be:

forceinline CodeBody parse_global_body(Str body_def) { return parse_global_body(_ctx, body-def); } 

The downside for this is that in C the warp & baseline would conflict in name so we'd need to give both unique names and then generate a generic selection for either (not like that doesn't already happen for other functions)

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

  • Status

    No status

Relationships

None yet

Development

No branches or pull requests

Issue actions