esp32-idf-sqlite3 icon indicating copy to clipboard operation
esp32-idf-sqlite3 copied to clipboard

feature: automatically use psram if available?

Open elklaaso opened this issue 1 year ago • 2 comments

by changing this in sqlite.c:

#define SQLITE_MALLOC(x) malloc(x) #define SQLITE_FREE(x) free(x) #define SQLITE_REALLOC(x,y) realloc((x),(y))

to:

#ifdef BOARD_HAS_PSRAM #define SQLITE_MALLOC(x) ps_malloc(x) #define SQLITE_FREE(x) free(x) #define SQLITE_REALLOC(x,y) ps_realloc((x),(y)) #else #define SQLITE_MALLOC(x) malloc(x) #define SQLITE_FREE(x) free(x) #define SQLITE_REALLOC(x,y) realloc((x),(y)) #endif

psram can then be enabled with this build flag: -DBOARD_HAS_PSRAM

or is it the goal to leave sqlite.c unedited?

elklaaso avatar Dec 08 '23 11:12 elklaaso

@elklaaso Hi thanks for sharing this. Yes this looks like a good idea. sqlite.c already has some changes from the original so it is alright to do this although it may be a good idea to minimize changing it.

siara-cc avatar Dec 12 '23 16:12 siara-cc

great, also did not notice any significant performance degradation on psram btw.

elklaaso avatar Dec 14 '23 12:12 elklaaso