![]() |
![]() |
![]() |
PolicyKit Library Reference Manual | ![]() |
---|---|---|---|---|
void* kit_malloc (size_t bytes); void* kit_malloc0 (size_t bytes); void* kit_realloc (void *memory, size_t bytes); void kit_free (void *memory); #define kit_new (type, count) #define kit_new0 (type, count)
void* kit_malloc (size_t bytes);
Allocate memory
|
number of 8-bit bytes to allocate |
Returns : |
memory location or NULL on OOM. Free with kit_free() .
|
void* kit_malloc0 (size_t bytes);
Allocate memory and zero it.
|
number of 8-bit bytes to allocate |
Returns : |
memory location or NULL on OOM. Free with kit_free() .
|
void* kit_realloc (void *memory, size_t bytes);
Reallocate memory; like realloc(3).
|
memory previously allocated |
|
new size |
Returns : |
memory location or NULL on OOM. Free with kit_free() .
|
void kit_free (void *memory);
Free memory allocated by kit_malloc()
+ friends.
|
pointer to memory allocated with kit_malloc() + friends
|
#define kit_new(type, count) ((type*)kit_malloc (sizeof (type) * (count)));
Allocate memory for count
structures of type type
.
|
the type of object to allocate |
|
number of objects to allocate |