Refactor.

This commit is contained in:
Nuno Cruces
2023-01-26 14:52:38 +00:00
parent 7f6213fbdb
commit eee0c60a5c
13 changed files with 406 additions and 446 deletions

11
api.go
View File

@@ -15,18 +15,11 @@ func newConn(module api.Module) *Conn {
if global == nil {
panic(noGlobalErr + "malloc_destructor")
}
destructor := uint32(global.Get())
if destructor == 0 {
panic(noGlobalErr + "malloc_destructor")
}
destructor, ok := module.Memory().ReadUint32Le(destructor)
if !ok {
panic(noGlobalErr + "malloc_destructor")
}
destructor := memory{module}.readUint32(uint32(global.Get()))
return &Conn{
module: module,
memory: module.Memory(),
memory: memory{module},
api: sqliteAPI{
malloc: getFun("malloc"),
free: getFun("free"),