diff options
| author | 2026-11-11 22:24:54 +0000 | |
|---|---|---|
| committer | 2026-11-11 23:15:15 +0000 | |
| commit | e281c39d24793ea5793b0eabdd684c5e12ea77fe (patch) | |
| tree | 1f1debed802fcc1764d33b05d21d7935bead3d19 /src/sst.c | |
| parent | de8db70103b5ba472fa6e3992e4c7ebb6dcae153 (diff) | |
| download | sst-e281c39d24793ea5793b0eabdd684c5e12ea77fe.tar.gz sst-e281c39d24793ea5793b0eabdd684c5e12ea77fe.zip | |
Add a mem_copy_fixed and mem_set_fixed to mem.h
Probably self-explanatory. I was finding more use cases for the
__builtin_memcpy_inline thing but boy is that ugly.
Diffstat (limited to 'src/sst.c')
| -rw-r--r-- | src/sst.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -197,11 +197,9 @@ c: mem_copy(r, p + slash + 1, rellen); if_cold (f == -1) { errmsg_errorsys("couldn't open %" fS, path); return; } #ifdef _WIN32 char buf[19 + PATH_MAX]; - // XXX: with actual calls to memcpy gone, we need this builtin to produce 4 - // 4-byte movs from this string; can we expose this in a less hideous way? - __builtin_memcpy_inline(buf, "Plugin { file \"", 15); + mem_copy_fixed(buf, "Plugin { file \"", 15); for (int i = 0; i < rellen; ++i) buf[i + 15] = relpath[i]; - __builtin_memcpy_inline(buf + 15 + rellen, "\" }\n", 4); + mem_copy_fixed(buf + 15 + rellen, "\" }\n", 4); if_cold (os_write(f, buf, rellen + 19) == -1) { // blegh #else struct iovec iov[3] = { |
