*** DRAFT ***

SQLite Requirement Matrix Details
free.html

Index Summary Markup Original


R-08220-00712-08202-21182-26079-26258-28714-22258 tcl slt th3 src

The sqlite3_malloc() routine returns a pointer to a block of memory at least N bytes in length, where N is the parameter.

th3/req1/malloc02.test:44

/* IMP: R-08220-00712 */
# EVIDENCE-OF: R-08220-00712 The sqlite3_malloc() routine returns a
# pointer to a block of memory at least N bytes in length, where N is
# the parameter.

R-56692-55226-52354-63477-50727-27057-22841-42848 tcl slt th3 src

If sqlite3_malloc() is unable to obtain sufficient free memory, it returns a NULL pointer.

th3/req1/malloc02.test:60

/* IMP: R-56692-55226 */
# EVIDENCE-OF: R-56692-55226 If sqlite3_malloc() is unable to obtain
# sufficient free memory, it returns a NULL pointer.

R-65312-04917-64079-24281-62446-41326-63748-51040 tcl slt th3 src

If the parameter N to sqlite3_malloc() is zero or negative then sqlite3_malloc() returns a NULL pointer.

th3/req1/malloc02.test:106

/* IMP: R-65312-04917 */
# EVIDENCE-OF: R-65312-04917 If the parameter N to sqlite3_malloc() is
# zero or negative then sqlite3_malloc() returns a NULL pointer.

R-23595-60076-32539-07407-36536-15376-05711-31213 tcl slt th3 src

The sqlite3_malloc64(N) routine works just like sqlite3_malloc(N) except that N is an unsigned 64-bit integer instead of a signed 32-bit integer.

th3/req1/malloc02.test:144   th3/req1/malloc02.test:78

/* IMP: R-23595-60076 */
# EVIDENCE-OF: R-23595-60076 The sqlite3_malloc64(N) routine works just
# like sqlite3_malloc(N) except that N is an unsigned 64-bit integer
# instead of a signed 32-bit integer.

R-17203-10061-39568-47821-02948-38975-34395-48032 tcl slt th3 src

Calling sqlite3_free() with a pointer previously returned by sqlite3_malloc() or sqlite3_realloc() releases that memory so that it might be reused.

th3/req1/malloc02.test:124

/* IMP: R-17203-10061 */
# EVIDENCE-OF: R-17203-10061 Calling sqlite3_free() with a pointer
# previously returned by sqlite3_malloc() or sqlite3_realloc() releases
# that memory so that it might be reused.

R-49053-54554-23954-60675-57503-20600-08222-18852 tcl slt th3 src

The sqlite3_free() routine is a no-op if is called with a NULL pointer.

src/malloc.c:394   th3/req1/malloc02.test:164

/* IMP: R-49053-54554 */
# EVIDENCE-OF: R-49053-54554 The sqlite3_free() routine is a no-op if is
# called with a NULL pointer.

R-50848-12841-20813-56140-49872-26884-10100-43197 tcl slt th3 src

The sqlite3_realloc(X,N) interface attempts to resize a prior memory allocation X to be at least N bytes.

th3/req1/malloc02.test:207

/* IMP: R-50848-12841 */
# EVIDENCE-OF: R-50848-12841 The sqlite3_realloc(X,N) interface attempts
# to resize a prior memory allocation X to be at least N bytes.

R-04300-56712-32659-65159-49842-27130-29205-32160 tcl slt th3 src

If the X parameter to sqlite3_realloc(X,N) is a NULL pointer then its behavior is identical to calling sqlite3_malloc(N).

src/malloc.c:511   th3/req1/malloc02.test:261

/* IMP: R-04300-56712 */
# EVIDENCE-OF: R-04300-56712 If the X parameter to sqlite3_realloc(X,N)
# is a NULL pointer then its behavior is identical to calling
# sqlite3_malloc(N).

R-26507-47431-65188-24932-00073-09728-32384-65254 tcl slt th3 src

If the N parameter to sqlite3_realloc(X,N) is zero or negative then the behavior is exactly the same as calling sqlite3_free(X).

src/malloc.c:514   src/malloc.c:568   th3/req1/malloc02.test:171

/* IMP: R-26507-47431 */
# EVIDENCE-OF: R-26507-47431 If the N parameter to sqlite3_realloc(X,N)
# is zero or negative then the behavior is exactly the same as calling
# sqlite3_free(X).

R-25722-54578-39151-48243-45997-39827-22901-27237 tcl slt th3 src

sqlite3_realloc(X,N) returns a pointer to a memory allocation of at least N bytes in size or NULL if insufficient memory is available.

th3/req1/malloc02.test:321

/* IMP: R-25722-54578 */
# EVIDENCE-OF: R-25722-54578 sqlite3_realloc(X,N) returns a pointer to a
# memory allocation of at least N bytes in size or NULL if insufficient
# memory is available.

R-59903-02736-29653-35997-33194-50062-38797-30798 tcl slt th3 src

If M is the size of the prior allocation, then min(N,M) bytes of the prior allocation are copied into the beginning of buffer returned by sqlite3_realloc(X,N) and the prior allocation is freed.

th3/req1/malloc02.test:316

/* IMP: R-59903-02736 */
# EVIDENCE-OF: R-59903-02736 If M is the size of the prior allocation,
# then min(N,M) bytes of the prior allocation are copied into the
# beginning of buffer returned by sqlite3_realloc(X,N) and the prior
# allocation is freed.

R-18701-28385-27325-47261-28842-16656-24212-49294 tcl slt th3 src

If sqlite3_realloc(X,N) returns NULL and N is positive, then the prior allocation is not freed.

th3/req1/malloc02.test:335   th3/req1/malloc02.test:362

/* IMP: R-18701-28385 */
# EVIDENCE-OF: R-18701-28385 If sqlite3_realloc(X,N) returns NULL and N
# is positive, then the prior allocation is not freed.

R-36007-42565-41988-28835-07682-45738-21986-28193 tcl slt th3 src

The sqlite3_realloc64(X,N) interfaces works the same as sqlite3_realloc(X,N) except that N is a 64-bit unsigned integer instead of a 32-bit signed integer.

th3/req1/malloc02.test:233   th3/req1/malloc02.test:287   th3/req1/malloc02.test:348

/* IMP: R-36007-42565 */
# EVIDENCE-OF: R-36007-42565 The sqlite3_realloc64(X,N) interfaces works
# the same as sqlite3_realloc(X,N) except that N is a 64-bit unsigned
# integer instead of a 32-bit signed integer.

R-64601-24454-22641-31955-15642-29153-65084-11267 tcl slt th3 src

If X is a memory allocation previously obtained from sqlite3_malloc(), sqlite3_malloc64(), sqlite3_realloc(), or sqlite3_realloc64(), then sqlite3_msize(X) returns the size of that memory allocation in bytes.

th3/req1/malloc02.test:30

/* IMP: R-64601-24454 */
# EVIDENCE-OF: R-64601-24454 If X is a memory allocation previously
# obtained from sqlite3_malloc(), sqlite3_malloc64(), sqlite3_realloc(),
# or sqlite3_realloc64(), then sqlite3_msize(X) returns the size of that
# memory allocation in bytes.

R-19846-48503-04889-44735-07429-55750-55258-63586 tcl slt th3 src

The value returned by sqlite3_msize(X) might be larger than the number of bytes requested when X was allocated.

th3/req1/malloc02.test:383

/* IMP: R-19846-48503 */
# EVIDENCE-OF: R-19846-48503 The value returned by sqlite3_msize(X)
# might be larger than the number of bytes requested when X was
# allocated.

R-01244-21922-18443-41581-31463-56152-20699-08111 tcl slt th3 src

If X is a NULL pointer then sqlite3_msize(X) returns zero.

th3/req1/malloc02.test:376

/* IMP: R-01244-21922 */
# EVIDENCE-OF: R-01244-21922 If X is a NULL pointer then
# sqlite3_msize(X) returns zero.

R-11148-40995-48554-02818-10393-13608-40990-18433 tcl slt th3 src

The memory returned by sqlite3_malloc(), sqlite3_realloc(), sqlite3_malloc64(), and sqlite3_realloc64() is always aligned to at least an 8 byte boundary, or to a 4 byte boundary if the SQLITE_4_BYTE_ALIGNED_MALLOC compile-time option is used.

src/malloc.c:309   src/malloc.c:556   th3/req1/malloc02.test:10

/* IMP: R-11148-40995 */
# EVIDENCE-OF: R-11148-40995 The memory returned by sqlite3_malloc(),
# sqlite3_realloc(), sqlite3_malloc64(), and sqlite3_realloc64() is
# always aligned to at least an 8 byte boundary, or to a 4 byte boundary
# if the SQLITE_4_BYTE_ALIGNED_MALLOC compile-time option is used.