docs/Writerside/topics/buffer.h.md

changeset 1263
f993745c60f0
parent 1262
7cc81244b28a
child 1264
8ff604356af7
equal deleted inserted replaced
1262:7cc81244b28a 1263:f993745c60f0
39 ``` 39 ```
40 40
41 <warning> 41 <warning>
42 TODO: document 42 TODO: document
43 </warning> 43 </warning>
44
45 | Flag | Description |
46 |--------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
47 | CX_BUFFER_DEFAULT | Alias for zero, meaning no flags are set. |
48 | CX_BUFFER_FREE_CONTENTS | When the buffer structure is [destroyed](#destroy), the memory for the contents is also automatically deallocated. |
49 | CX_BUFFER_AUTO_EXTEND | When a write operation would exceed the buffers capacity, the buffer is grown automatically with a call to `cxBufferMinimumCapacity()`. |
50 | CX_BUFFER_COPY_ON_WRITE | Any write operation will result in allocating a copy of the data, first. This is particularly useful, when a buffer is initialized with read-only memory. |
51 | CX_BUFFER_COPY_ON_EXTEND | Only when a write operation would exceed the buffers capacity, the copy-on-write operation is performed. This is useful, when a buffer is initialized with read-write memory which is allocated on the stack. |
52
44 53
45 ## Destroy 54 ## Destroy
46 55
47 ```C 56 ```C
48 #include <cx/buffer.h> 57 #include <cx/buffer.h>

mercurial