Skip to main content
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
1 vote
2 answers
72 views

Why defining string within a function scope allocates it on heap instead of a stack? [duplicate]

According this awesome article there is an interesting case with two given examples: A: B: And there is an explanation for A: Unfortunately you have not taken into account that such Strings will ...
Bartłomiej Semańczyk's user avatar
0 votes
0 answers
51 views

Calling ARC code from non-ARC code causing EXC_BAD_ACCESS when autorelease pool drains

void test(void) { @autoreleasepool { NSDictionary *dict = copyDict(); NSLog(@"%lu", [dict retainCount]); [dict release]; } } int main (int argc, const char * ...
Yijue Xu's user avatar
1 vote
1 answer
119 views

How do I use Arc with interior mutability over slices?

MRE: use std::sync::Arc; use std::thread; fn main() { let arr1 = Arc::new(vec![10; 100]); let arr2 = Arc::new(vec![20; 100]); let arr3 = Arc::new(vec![00; 100]); // Going to need interior ...
kesarling's user avatar
  • 2,304
0 votes
0 answers
56 views

NSObject proxy with weak delegate crashes with NSInvalidArgumentException unrecognized selector

I'm debugging a library that implements a UIScrollViewDelegate proxy (essentially) like: class ScrollViewDelegateProxy: NSObject, UIScrollViewDelegate { private weak var realDelegate: ...
Bechsh's user avatar
  • 453
2 votes
1 answer
69 views

Reference counting an uninitialized object

I have some Objective C code compiled with ARC: void func(void) { NSString *string; // Do some stuff. Maybe return early. string = @"initialized"; // Other stuff. } How ...
Daniel Walker's user avatar
2 votes
1 answer
89 views

Arc: how to enable audio player for my own website?

I'm trying to enable the Arc browser audio player on a webpage of mine. I cannot find any documentation from Arc targeted to developers though, so I tried by using what works for Google Chrome, but it ...
Eliot Ragueneau's user avatar
1 vote
2 answers
115 views

Should 'self' be explicitly specified in closure with weak reference to self in capture list?

DispatchQueue.main.async { view.setNeedsLayout() } With above code we get expected error: Implicit use of 'self' in closure; use 'self.' to make capture semantics explicit. It's known that the ...
bart's user avatar
  • 324
0 votes
0 answers
36 views

ARC and the release of custom objects passed into async network methods

In my app I’m running into a problem leaking custom objects passed into a chain of methods that store HTML files into a custom object. Where each method finds a local copy of a file, the file is read ...
johnpurlia's user avatar
0 votes
2 answers
96 views

mutate dynamically sized vec in parallel

I'm trying to mutate a dynamically sized (i.e. under certain conditions, new values are pushed, and pop() gets called in every iteration) Vec in parallel. Am I doing anything wrong in this working ...
Chad's user avatar
  • 1,530
0 votes
0 answers
57 views

Deallocation for NSTextView in Objective-C

I am learning to create a Cocoa application on Mac OS and have run into an issue with memory I don't quite understand. From what I've read with non-ARC is that you should be releasing anything you've ...
Charlie's user avatar
  • 771
0 votes
0 answers
27 views

Instantiating ONNX Session and Environment and overcoming borrowing error without having to use unsafe pointers [duplicate]

I have been trying to instantiate an ONNX runtime environment and session within a struct that can also contain all of the public methods I need. I have a working solution, however this requires the ...
James's user avatar
  • 143
0 votes
1 answer
69 views

Fill a matrix in parallel - how to convert `Vec<Arc<Mutex<Vec<_>>>>` to Vec<Vec<_>>`

I'm learning Rust and just finished the Fearless Concurrency chapter in the Rust book, so am trying to fill up the rows of a matrix in parallel. My matrix is large, so I send a chunk of rows to each ...
Raf's user avatar
  • 1,789
1 vote
1 answer
241 views

How does the NSWindow isReleasedWhenClosed property work when using ARC?

In Objective-C with ARC or Swift (which always uses ARC), what difference does it make whether isReleasedWhenClosed is true or not? Won't a window be kept alive as long as my code has strong ...
Mecki's user avatar
  • 135k
0 votes
1 answer
375 views

Acquiring an access token using REST API on a ARC Connected VM

I'm wanting to connect a On-Prem VM to Azure KeyVault. I have installed the Azure Arc Agent successfully and can see the VM under ARC Machines in Azure. However when I go to request the API token as ...
Shane's user avatar
  • 1
1 vote
1 answer
202 views

Is there a sound way to convert/transmute from Arc<String> to Arc<Vec<u8>>

String and Vec<u8> have the same memory layout, although this is not guaranteed. String also has an into_bytes method returning a Vec<u8>. Is there a sound way to convert from an Arc<...
ChrisB's user avatar
  • 4,116

15 30 50 per page
1
2 3 4 5
256
Morty Proxy This is a proxified and sanitized view of the page, visit original site.