Name
sqlite3_malloc() — Obtain a dynamic memory allocation
Definition
void* sqlite3_malloc( int bytes );
-
bytes The size of the requested allocation, in bytes.
- Returns
A newly allocated buffer. If the memory is not available, NULL is returned.
Description
This function obtains a dynamic memory allocation from the
SQLite library. Memory allocated with sqlite3_malloc() should be released with
sqlite3_free().
Allocations will always start on an 8-byte (or larger)
boundary.
Although many SQLite environments will simply pass memory allocation requests on to the default system memory allocator, there are some environments that configure specific buffers for the SQLite library. By using these memory handling functions, an SQLite extension or module will work correctly in any SQLite environment, regardless of how the memory allocator is configured.
See Also
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access