added chunk_from_thing() macro
This commit is contained in:
@@ -88,6 +88,11 @@ void chunk_free(chunk_t *chunk);
|
|||||||
*/
|
*/
|
||||||
#define chunk_from_buf(str) { str, sizeof(str) }
|
#define chunk_from_buf(str) { str, sizeof(str) }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Initialize a chunk to point to a thing
|
||||||
|
*/
|
||||||
|
#define chunk_from_thing(thing) chunk_create((char*)&(thing), sizeof(thing))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allocate a chunk on the heap
|
* Allocate a chunk on the heap
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user