diff options
| -rw-r--r-- | docs/csptr_api.md | 3 | ||||
| -rw-r--r-- | examples/sharedptr.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/docs/csptr_api.md b/docs/csptr_api.md index 8a6881be..ce70d3c8 100644 --- a/docs/csptr_api.md +++ b/docs/csptr_api.md @@ -1,6 +1,6 @@ # STC [csptr](../include/stc/csptr.h): Shared Pointers -**csptr** is a smart pointer that retains shared ownership of an object through a pointer. +**csptr** is a smart pointer that retains shared ownership of an object through a pointer. Several **csptr** objects may own the same object. The object is destroyed and its memory deallocated when either of the following happens: @@ -124,6 +124,7 @@ vec: 2021 2012 2022 2015 del: 2022 vec: 2021 2012 set: 2015 2021 +2021 is now owned by 3 objects Done del: 2015 del: 2021 diff --git a/examples/sharedptr.c b/examples/sharedptr.c index daaf646f..a45e19bc 100644 --- a/examples/sharedptr.c +++ b/examples/sharedptr.c @@ -47,7 +47,7 @@ int main() printf("\n%d is now owned by %zu objects\n", *p.get, *p.use_count);
}
- puts("\nDone");
+ puts("Done");
}
}
|
