|
Lime Parser Generator 0.1.0
Runtime-extensible LALR(1) parser with SIMD tokenization and LLVM JIT
|
Atomically replace the active plugin and snapshot. More...
Functions | |
| ParserManagerStatus | parser_manager_hot_swap (ParserManager *mgr, LimePluginHandle new_handle, const char *grammar_file) |
| Atomically replace the active plugin and snapshot. | |
Atomically replace the active plugin and snapshot.
| ParserManagerStatus parser_manager_hot_swap | ( | ParserManager * | mgr, |
| LimePluginHandle | new_handle, | ||
| const char * | grammar_file | ||
| ) |
#include <include/parser_manager.h>
Atomically replace the active plugin and snapshot.
Equivalent to parser_manager_set_active() but guarantees that the transition is atomic from the perspective of parser_manager_get_snapshot() callers. There is no window where get_snapshot() returns NULL or an intermediate state.
The old snapshot is released once all references to it are dropped (existing parse sessions keep their pinned references).
| mgr | The parser manager. |
| new_handle | Handle of the plugin to activate. |
| grammar_file | Grammar file for create_snapshot(). May be NULL if a snapshot is already available. |