go-re2 icon indicating copy to clipboard operation
go-re2 copied to clipboard

Use custom allocator on Windows

Open anuraaga opened this issue 9 months ago • 1 comments

Also makes sure to cap max pages on 32-bit systems regardless for extra safety

anuraaga avatar May 17 '24 03:05 anuraaga

@ncruces would you be able to take a look at this PR? BTW, the only testing I've done is the windows job in the CI here

anuraaga avatar May 17 '24 03:05 anuraaga

Thanks a lot for the help @ncruces! added the cleanups

anuraaga avatar May 20 '24 01:05 anuraaga

I was going over this again, and as the wazero API shifted for a while, I guess this slipped.

It turns out that we don't need to commit memory in the constructor unless we really want to, because Reallocate is called right afterwards: https://github.com/ncruces/go-sqlite3/commit/d23bdcd225527d8782b6dfc8888f5ed82f87a61b

So it's up to you if you want to use WithMemoryCapacityFromMax as a signal to commit all memory right away (in that case you want to commit in the constructor), or if you rather to skip this in the constructor as well.

ncruces avatar May 20 '24 08:05 ncruces