Skip to main content

Questions tagged [reference-counting]

Filter by
Sorted by
Tagged with
0 votes
1 answer
269 views

I'm devising an API - or actually, a wrapper API for another, lower-level API - in a programming language with objects. This API represents some entity E which is reference-counted (for example - a ...
einpoklum's user avatar
  • 2,808
0 votes
2 answers
1k views

The Rust programming language offers a Arc atomic reference counting generic type for use in multi-threading environment, since Rc is optimized for performance in single-threaded applications, and ...
DannyNiu's user avatar
  • 374
3 votes
3 answers
758 views

My problem is the following: inside a method I'm creating an object like this: MyObject* myObject = [MyObject new]; Then I want it to perform an asynchronous task like this: [myObject ...
Andrey Chernukha's user avatar
1 vote
2 answers
874 views

I can't find the exact tweet, but it was stated by Apple engineers that the retain and release operations are faster on Intel x86 translation than on standard Intel x86.
Curious's user avatar
  • 95
0 votes
2 answers
246 views

The only way I know of is to copy the whole heap by allocating copies of all objects on a new heap and dropping the old one, like couchbase db does for example. Presumably you could also do the same ...
Drathier's user avatar
  • 2,883
11 votes
5 answers
5k views

Java and .NET have wonderful garbage collectors that manage memory for you, and convenient patterns for quickly releasing external objects (Closeable, IDisposable), but only if they are owned by a ...
C. Ross's user avatar
  • 2,926
6 votes
4 answers
885 views

I want to keep a dependency decoupled, but at the same time, once it's passed to the constructor, I want to allow changes only through Whatever (in the following example) because changing the ...
Wes's user avatar
  • 872
-1 votes
3 answers
414 views

I just wrote this code that uses a goto statement. if (PyMethod_Check(attrib_value)) { PyObject *im_self = PyObject_GetAttrString(attrib_value, "im_self"); if (im_self == Py_None) { ...
tbodt's user avatar
  • 115
3 votes
2 answers
148 views

What is best (or commonly accepted) practice for where to declare COM object variables (scope) and how to handle cleaning them up when using structured error handling? I just spend a whole load of ...
CBRF23's user avatar
  • 269
78 votes
3 answers
60k views

I starting working through an online course on iOS development in the new language from Apple, Swift. The instructor made a point that raised this question in my mind. He said something to the ...
Aaron Anodide's user avatar