Define a symbol in the internal symbol table. The JIT will use the symbol table to resolve names that are declared, but not defined, in the module being compiled. A common example is external functions. With this method, functions and data can be exposed to the code being compiled which are defined by the host. If a symbol is defined more than once, the most recent definition will be retained.
(&mut self, name: K, ptr: *const u8)
| 113 | /// the current process for public symbols, followed by searching the |
| 114 | /// platform's C runtime). |
| 115 | pub fn symbol<K>(&mut self, name: K, ptr: *const u8) -> &mut Self |
| 116 | where |
| 117 | K: Into<String>, |
| 118 | { |
| 119 | self.symbols.insert(name.into(), SendWrapper(ptr)); |
| 120 | self |
| 121 | } |
| 122 | |
| 123 | /// Define multiple symbols in the internal symbol table. |
| 124 | /// |
no test coverage detected