Commit feba674
authored
C: Optimize
This pull request converts the `hb_string()` function to a macro and
renames the existing `hb_string` function to `hb_string_from_c_string`.
We do this in order to optimize `hb_string()` calls with static string
literals so that they have no runtime-overhead for converting a C-String
to a `hb_string_T`.
This applies for calls like:
```c
hb_string("<%")
hb_string("%>")
```
For dynamic strings it will fallback to `hb_string_from_c_string()`:
```c
hb_string(variable)
hb_string(message)
```hb_string() to compute length at compile time (#1318)1 parent 61fabe9 commit feba674
2 files changed
+8
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
19 | 25 | | |
20 | 26 | | |
21 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
0 commit comments