Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from writeStringToMemory to stringToUTF8 #192

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions coffee/api.coffee
Expand Up @@ -314,8 +314,9 @@ class Database
# Store the SQL string in memory. The string will be consumed, one statement
# at a time, by sqlite3_prepare_v2_sqlptr.
# Allocate at most 4 bytes per UTF8 char, +1 for the trailing '\0'
nextSqlPtr = stackAlloc(sql.length<<2 + 1)
writeStringToMemory sql, nextSqlPtr
buflen = sql.length<<2 + 1
nextSqlPtr = Runtime.stackAlloc(buflen)
stringToUTF8 sql, nextSqlPtr, buflen
# Used to store a pointer to the next SQL statement in the string
pzTail = stackAlloc(4)

Expand Down