Skip to content

Commit 1eb9c4c

Browse files
ios: set node thread stack size to 2 MB
1 parent dd008ac commit 1eb9c4c

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

ios/native-xcode-node-folder/native-xcode-node-folder/AppDelegate.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3232
selector:@selector(startNode)
3333
object:nil
3434
];
35-
// Set 1MB of stack space for the Node.js thread,
36-
// the same as the iOS application's main thread.
37-
[nodejsThread setStackSize:1024*1024];
35+
// Set 2MB of stack space for the Node.js thread.
36+
[nodejsThread setStackSize:2*1024*1024];
3837
[nodejsThread start];
3938
return YES;
4039
}

ios/native-xcode/README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,15 +175,14 @@ Create a `startNode` selector and start the thread that runs the node project in
175175
selector:@selector(startNode)
176176
object:nil
177177
];
178-
// Set 1MB of stack space for the Node.js thread,
179-
// the same as the iOS application's main thread.
180-
[nodejsThread setStackSize:1024*1024];
178+
// Set 2MB of stack space for the Node.js thread.
179+
[nodejsThread setStackSize:2*1024*1024];
181180
[nodejsThread start];
182181
return YES;
183182
}
184183
```
185184

186-
> The iOS node runtime expects to have 1MB of stack space available.
185+
> The iOS node runtime expects to have 1MB of stack space available. Having 2MB of stack space available is recommended.
187186
188187
### Run the Application
189188

ios/native-xcode/native-xcode/AppDelegate.m

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3737
selector:@selector(startNode)
3838
object:nil
3939
];
40-
// Set 1MB of stack space for the Node.js thread,
41-
// the same as the iOS application's main thread.
42-
[nodejsThread setStackSize:1024*1024];
40+
// Set 2MB of stack space for the Node.js thread.
41+
[nodejsThread setStackSize:2*1024*1024];
4342
[nodejsThread start];
4443
return YES;
4544
}

0 commit comments

Comments
 (0)