summaryrefslogtreecommitdiffhomepage
path: root/docs
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2023-01-04 22:55:08 +0100
committerTyge Lovset <[email protected]>2023-01-04 22:55:08 +0100
commitf89ba241b30a9335a8354c435c377cfcf9841de2 (patch)
tree233b72f88793dbd4fcb93ff3965b83986ea01eef /docs
parent3812789b283f59d2cc4ca0bd32c4edbd7742ef99 (diff)
downloadSTC-modified-f89ba241b30a9335a8354c435c377cfcf9841de2.tar.gz
STC-modified-f89ba241b30a9335a8354c435c377cfcf9841de2.zip
Removed the experimental c_AUTODROP macro.
Diffstat (limited to 'docs')
-rw-r--r--docs/carray_api.md2
-rw-r--r--docs/ccommon_api.md5
2 files changed, 3 insertions, 4 deletions
diff --git a/docs/carray_api.md b/docs/carray_api.md
index cd4e0e45..803a1610 100644
--- a/docs/carray_api.md
+++ b/docs/carray_api.md
@@ -90,7 +90,7 @@ int main()
// Ex1
int xd = 30, yd = 20, zd = 10;
// define arr3[30][20][10], initialized with zeros.
- c_AUTODROP (carr3_f, arr3, carr3_f_with_size(xd, yd, zd, 0.0f)) {
+ c_WITH (carr3_f arr3 = carr3_f_with_size(xd, yd, zd, 0.0f), carr3_f_drop(&arr3)) {
arr3.data[5][4][3] = 3.14f;
float *arr1 = arr3.data[5][4];
diff --git a/docs/ccommon_api.md b/docs/ccommon_api.md
index d5ecc430..bb9efac4 100644
--- a/docs/ccommon_api.md
+++ b/docs/ccommon_api.md
@@ -3,7 +3,7 @@
The following macros are recommended to use, and they safe/have no side-effects.
## Scope macros (RAII)
-### c_AUTO, c_AUTODROP, c_WITH, c_SCOPE, c_DEFER
+### c_AUTO, c_WITH, c_SCOPE, c_DEFER
General ***defer*** mechanics for resource acquisition. These macros allows you to specify the
freeing of the resources at the point where the acquisition takes place.
The **checkauto** utility described below, ensures that the `c_AUTO*` macros are used correctly.
@@ -13,7 +13,6 @@ The **checkauto** utility described below, ensures that the `c_AUTO*` macros are
| `c_WITH (Type var=init, drop)` | Declare `var`. Defer `drop...` to end of scope |
| `c_WITH (Type var=init, pred, drop)` | Adds a predicate in order to exit early if init failed |
| `c_AUTO (Type, var1,...,var4)` | `c_WITH (Type var1=Type_init(), Type_drop(&var1))` ... |
-| `c_AUTODROP (Type, var, init...)` | Like `c_WITH (Type var=init..., Type_drop(&var))` |
| `c_SCOPE (init, drop)` | Execute `init` and defer `drop` to end of scope |
| `c_DEFER (drop...)` | Defer `drop...` to end of scope |
| `continue` | Exit a block above without memory leaks |
@@ -50,7 +49,7 @@ c_AUTO (cstr, s1, s2)
printf("%s %s\n", cstr_str(&s1), cstr_str(&s2));
}
-c_AUTODROP (cstr, str, cstr_lit("Hello"))
+c_WITH (cstr str = cstr_lit("Hello"), cstr_drop(&str))
{
cstr_append(&str, " world");
printf("%s\n", cstr_str(&str));