mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-12 16:50:21 +00:00
Update docs
This commit is contained in:
1 parent
cb0ac1868f
commit
cc9639b3cb
1 file changed
+3
-2
+3
-2
@@ -1397,12 +1397,13 @@ to 0.
|
|||||||
### mg\_iobuf\_add()
|
### mg\_iobuf\_add()
|
||||||
|
|
||||||
```c
|
```c
|
||||||
size_t mg_iobuf_add(struct mg_iobuf *io, size_t offset, const void *buf, size_t len, size_t granularity);
|
size_t mg_iobuf_add(struct mg_iobuf *io, size_t offset, const void *buf, size_t len, size_t align);
|
||||||
```
|
```
|
||||||
|
|
||||||
Insert data buffer `buf`, `len` at offset `offset`. The iobuf gets
|
Insert data buffer `buf`, `len` at offset `offset`. The iobuf gets
|
||||||
is expanded if required. The resulting `io->size` is always
|
is expanded if required. The resulting `io->size` is always
|
||||||
aligned to the `granularity` byte boundary. Example:
|
aligned to the `align` byte boundary - therefore, to avoid memory fragmentation
|
||||||
|
and frequent reallocations, set `align` to a higher value. Example:
|
||||||
|
|
||||||
```c
|
```c
|
||||||
struct mg_iobuf io;
|
struct mg_iobuf io;
|
||||||
|
|||||||
Reference in new issue
Block a user