Skip to main content
Filter by
Sorted by
Tagged with
1 vote
2 answers
83 views

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
59 views

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
143 views

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,334
0 votes
0 answers
59 views

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
71 views

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
108 views

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
126 views

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
44 views

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
99 views

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
66 views

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

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
71 views

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
279 views

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
417 views

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
219 views

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,156
1 vote
1 answer
65 views

I am trying to build a tree implementation in Swift to represent a chess game. A game consists of a sequence of moves but alternative moves for a given board position are valid. I want to traverse the ...
dehlen's user avatar
  • 7,399
1 vote
1 answer
53 views

I've the impression that my CALayer is retained after being added as a sublayer until the end execution block, instead of until I stop referencing it. The parent UIView is however released as soon as ...
Guig's user avatar
  • 10.6k
0 votes
0 answers
65 views

I am developing software in Objective-C that reads files in chunks and processes them. I noticed with very large files it slows down a lot. Looking in activity monitor it's pretty clear what's going ...
Foxyz's user avatar
  • 169
1 vote
1 answer
175 views

The code below is to reproduce what I encountered. After loading and cleaning data, the memory is still not freed. And the weirdest thing is that if I press the clean data twice, the memory could be ...
Perry Wang's user avatar
0 votes
0 answers
218 views

I'm working on a Rust application where I need to manage shared state between two threads using Arc and Mutex. The application has a Node struct that holds some data, and I'm trying to update this ...
Harsh Kumar Chourasia's user avatar
2 votes
1 answer
122 views

I know that we can use strong self in DispatchQueues when we call it directly in the code, for example: func foo() { DispatchQueue.global().async { print(self.someProperty) } } But ...
Oranutachi's user avatar
0 votes
0 answers
74 views

Have the following scenario. Basically I want to use the item binded sheet init and bind it to an optional property which will be set when we want to show the sheet. On the outside it looks perfectly ...
Boyan Pavlov's user avatar
1 vote
1 answer
75 views

How to weak self when setting function to closure as in 1. to work same as example 2. Any ideas? class TabController: UITabBarController { func setupViewActions() { tabView.itemTapped = changeTab //...
Gorthez's user avatar
  • 421
0 votes
1 answer
59 views

The code below can work. #[derive(Debug)] struct Test{ str1 : Option<String>, str2 : Option<String>, } fn main() { let mut test = Test{ str1 : Some(String::from("...
CreatorHell's user avatar
0 votes
0 answers
43 views

I want to draw a ring with the canvas that doesn't have the straight black line you see when you use the below code. var can = document.getElementById('canvas1'); var ctx = can.getContext('2d'); ...
Jim Andrews's user avatar
1 vote
0 answers
82 views

I am using the Synopsis ARC compiler for a multi-core (two cores) application, and I have a startup.s file written in assembly. To distinguish the behavior for the application on different cores, I ...
Vazeeruddin's user avatar
1 vote
0 answers
31 views

In swift, based on Apple's documentation reference types are stored on heap and value types on stack, but if a class definition has a struct variable for example String, where will that be stored? ...
Daksh Sabharwal's user avatar
0 votes
0 answers
40 views

I have to draw up panel setups for work and a lot of time goes into counting/listing how many of each panels there are, I've been looking into "count if" formulas and such with little ...
Teddi's user avatar
  • 1
0 votes
1 answer
153 views

First time submitting a question. One of my object visualization programs uses arcs as a connector between lines. The starting angle and extent are calculated. With some combinations of angle and ...
daddio's user avatar
  • 1
1 vote
2 answers
899 views

Environment: macOS Sonoma Ver.14.0 (M1 mac) Rust Ver.1.65.0 What I want to do: I want to share a vec with an array of [u8;128] elements between multithreads. The requirements I want to perform when ...
matsuisa's user avatar
0 votes
1 answer
165 views

I'm currently developing a native plugin for a Capcitor app. I have very little experience with native iOS development, Swift and Obj-C. I use a framework (FunSDK) which is written in C++. I call this ...
jalixdesign's user avatar
4 votes
2 answers
195 views

I am creating a gauge using svg. Is there a way to add an arrow at the end of the animated gauge to indicate the entered value? Since the gauge is displayed with the path's stroke-dasharray, it seems ...
Th Yoon's user avatar
  • 141
0 votes
0 answers
155 views

I'm currently working on a Xamarin.iOS project, and I've enabled ARC (Automatic Reference Counting) using the following setting in the "Additional mtouch arguments" field on the iOS Build ...
RaGib Noor's user avatar
0 votes
0 answers
89 views

I'm new to Swift's ARC and I'm having a possibly memory problem with the following swift code: class Device { let name: String var ports: [Port] init(name: String, ports: [Port] = []) { ...
user4779109's user avatar
1 vote
1 answer
2k views

I have a question regarding the Arc in Rust. I want to do something with multi-threading and stumbled on Arcs to give multiple threads access to the same data. At the moment, I use a struct with the ...
Cron3x's user avatar
  • 15
0 votes
1 answer
102 views

I have a C++ map which manages loaded regions. Each region has an associated MTLBuffer for the geometry generated after the region data is converted into a mesh. The idea is to store a reference to ...
CPlus's user avatar
  • 5,128
0 votes
0 answers
40 views

I currently have 2 classes. One of them is named DeckManager and holds Deck objects inside an Array collection named decks (Each Deck contains an array of Card objects). The next Class is named ...
CrisI.Kim's user avatar
0 votes
1 answer
224 views

I am using SnapKit to handle my AutoLayout. I am wondering does this code cause a memory leak because I am capturing self in a closure? writtenUpSwitch.snp.makeConstraints { $0.trailing....
Mark Thomas's user avatar
0 votes
1 answer
452 views

Here's a sample code snippet for a video player in SwiftUI, where the player's core is implemented in UIKit (specifically in PlayerViewController): struct Page: View { let delegate = Delegate() ...
FaiChou's user avatar
  • 851
1 vote
0 answers
105 views

Tried running Remix app in Arc sandbox via this command: node ./dev sandbox after doing npx remix build. It starts a sandbox in port 3001 when accessed in the browser it throws this error: Lambda ...
calcoder's user avatar
3 votes
2 answers
348 views

Consider the following use std::sync::{Arc,Mutex}; fn arc_mutex_from_slice<T>(v: &[T]) -> Arc<Mutex<[T]>> { todo!(); } fn main() { let v = vec![1,2,3]; println!(&...
luctowers's user avatar
1 vote
2 answers
271 views

I am writing a SwiftUI based Mac OS app that show a list of added files and allows the user to select them, and remove one or more selected files from the list, or remove everything from the list. To ...
kittonian's user avatar
  • 1,534
0 votes
1 answer
58 views

I'm in my first year of computer engineering, learning Java as my first programming language. I wanted to create a 'Fast Wheel Raffle' application, but I encountered a few issues. First of all: 1- I'm ...
Gökay Şahin's user avatar
4 votes
0 answers
156 views

Context I have a troublesome object from third-party code in a Python (3.10) program. The object is not written in pure Python; it's provided by an extension module. Due to a bug in the third party ...
Zac B's user avatar
  • 4,312
1 vote
0 answers
454 views

I know that the data inside an Arc is stored in heap, and when two objects have Arc reference to each other, they would not be dropped automatically by compiler. The following code shows this case. ...
hnyls2002's user avatar
  • 143
0 votes
2 answers
392 views

Say I have the following struct: struct MyStruct { field1: Box<MyField>, field2: Box<MyField>, } and I'd like to be able to do the following: Use the fields in separate threads in ...
Avi's user avatar
  • 1,356
0 votes
1 answer
1k views

While learning Rust, and trying to work through an example wherein a database Db is required to be shared across threads and functions. Link To Minimal Example I have wrapped the database (a struct) ...
O oLo O's user avatar
  • 31
0 votes
1 answer
204 views

I'm trying to do a spin wheel with d3.js. Everything worked fine with the old version 3. The pies and arcs didn't have any problem. When switching to d3.js v5 or later, i've got an omnipresent NaN in ...
GL.awog's user avatar
  • 1,322
1 vote
1 answer
83 views

I have a question about ARC in Swift, please take a look at the following code. When SecondViewController is presented, the alert will pop up, and once you click "OK" button, ...
Mark's user avatar
  • 11
2 votes
2 answers
488 views

I'm a little confused about how strong references are created and when reference cycles occur. Here's a simple example: class Model { var foo: Data? func makeRequest(url: URL) { ...
gsv37's user avatar
  • 23

1
2 3 4 5
77