Skip to content

Commit 7086d69

Browse files
author
Amanda Butler
authored
Copy edit SharedPtr.h
Copy edit for consistent capitalization and minor grammar nits.
1 parent 3c599fe commit 7086d69

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

platform/SharedPtr.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@
4848
* @endcode
4949
*
5050
*
51-
* It is similar to the std::shared_ptr class introduced in C++11,
52-
* however this is not a compatible implementation (no weak pointer, no make_shared, no custom deleters, etc.)
51+
* It is similar to the std::shared_ptr class introduced in C++11;
52+
* however, this is not a compatible implementation (no weak pointer, no make_shared, no custom deleters and so on.)
5353
*
5454
* Usage: SharedPtr<Class> ptr(new Class())
5555
*
56-
* When ptr is passed around by value the copy constructor and
56+
* When ptr is passed around by value, the copy constructor and
5757
* destructor manages the reference count of the raw pointer.
5858
* If the counter reaches zero, delete is called on the raw pointer.
5959
*
60-
* To avoid loops, "weak" references should be used by calling the original
60+
* To avoid loops, use "weak" references by calling the original
6161
* pointer directly through ptr.get().
6262
*/
6363

@@ -78,7 +78,7 @@ class SharedPtr {
7878
*/
7979
SharedPtr(T *ptr): _ptr(ptr), _counter(NULL)
8080
{
81-
// allocate counter on the heap so it can be shared
81+
// Allocate counter on the heap, so it can be shared
8282
if (_ptr != NULL) {
8383
_counter = new uint32_t;
8484
*_counter = 1;
@@ -87,7 +87,7 @@ class SharedPtr {
8787

8888
/**
8989
* @brief Destructor.
90-
* @details Decrement reference counter and delete object if no longer pointed to.
90+
* @details Decrement reference counter, and delete object if no longer pointed to.
9191
*/
9292
~SharedPtr()
9393
{
@@ -102,7 +102,7 @@ class SharedPtr {
102102
*/
103103
SharedPtr(const SharedPtr &source): _ptr(source._ptr), _counter(source._counter)
104104
{
105-
// increment reference counter
105+
// Increment reference counter
106106
if (_ptr != NULL) {
107107
core_util_atomic_incr_u32(_counter, 1);
108108
}
@@ -117,14 +117,14 @@ class SharedPtr {
117117
SharedPtr operator=(const SharedPtr &source)
118118
{
119119
if (this != &source) {
120-
// clean up by decrementing counter
120+
// Clean up by decrementing counter
121121
decrement_counter();
122122

123-
// assign new values
123+
// Assign new values
124124
_ptr = source.get();
125125
_counter = source.get_counter();
126126

127-
// increment new counter
127+
// Increment new counter
128128
if (_ptr != NULL) {
129129
core_util_atomic_incr_u32(_counter, 1);
130130
}
@@ -139,11 +139,11 @@ class SharedPtr {
139139
*/
140140
void reset(T *ptr)
141141
{
142-
// clean up by decrementing counter
142+
// Clean up by decrementing counter
143143
decrement_counter();
144144

145145
if (ptr != NULL) {
146-
// allocate counter on the heap so it can be shared
146+
// Allocate counter on the heap, so it can be shared
147147
_counter = new uint32_t;
148148
*_counter = 1;
149149
}
@@ -237,10 +237,10 @@ class SharedPtr {
237237
}
238238

239239
private:
240-
// pointer to shared object
240+
// Pointer to shared object
241241
T *_ptr;
242242

243-
// pointer to shared reference counter
243+
// Pointer to shared reference counter
244244
uint32_t *_counter;
245245
};
246246

0 commit comments

Comments
 (0)