Package: glib

Function glib:malloc

Lambda List

glib:malloc (nbytes)

Arguments

nbytes -- an integer of :size type with the number of bytes to allocate

Return Value

The foreign pointer to the allocated memory.

Details

Allocates nbytes bytes of memory. If the nbytes argument is 0 the g:malloc function returns a foreign cffi:null-pointer value.

Examples

(g:malloc 100)
=> #.(SB-SYS:INT-SAP #X559FB7283340)
(g:malloc 0)
=> #.(SB-SYS:INT-SAP #X00000000)
(cffi:null-pointer-p (g:malloc 0))
=> T    
 

See also

2024-10-12