Files
velzieandClaude Opus 5.5 57ff1c9d3d Rename the Wine codenames: W3 is wine32, W64 is wine64, item3 is native-libs
No key inputs (unit keys); rebuild inputs: the Wine dist keys, the gexcc install.

Paths, env names (W3_*, W64_*, GEX_W3_* become WINE32_*, WINE64_*,
GEX_WINE32_*), page switches and exports, identifiers and comments.
Unit-keyed and recovery-keyed names stay (W3_KUSER, GEX_W3_KUSER), so
unit keys are unchanged; the Wine dist keys change with the scripts
they hash.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_c8c04c00da9a4525ab21b0b9f146c598
2026-10-26 12:58:14 -04:00

25 lines
1.0 KiB
C

/* zstd's custom allocator calls (build-zstd.sh points allocations.h here).
* A ZSTD_customMem the caller gave is guest code, called as such; with none,
* zstd uses rt.c's malloc and free (ZSTD_malloc/ZSTD_free). A context made
* with one keeps it, so neither heap ever frees the other's blocks. */
#include "native-libs.h"
#define ZSTD_STATIC_LINKING_ONLY
#include "zstd.h"
void *gexp_zstd_alloc(ZSTD_customMem m, size_t size)
{
uint64_t a[2] = { (uint64_t)(uintptr_t)m.opaque, size };
return (void *)(uintptr_t)a64_call_guest((uint64_t)(uintptr_t)m.customAlloc, 2, a);
}
void gexp_zstd_free(ZSTD_customMem m, void *p)
{
uint64_t a[2] = { (uint64_t)(uintptr_t)m.opaque, (uint64_t)(uintptr_t)p };
a64_call_guest((uint64_t)(uintptr_t)m.customFree, 2, a);
}
#ifndef ZSTD_MULTITHREAD
/* Built without ZSTD_MULTITHREAD: no pool (ZSTD_CCtx_refThreadPool then
* has nothing to use, as with nbWorkers 0). */
ZSTD_threadPool *ZSTD_createThreadPool(size_t numThreads) { (void)numThreads; return 0; }
void ZSTD_freeThreadPool(ZSTD_threadPool *pool) { (void)pool; }
#endif