Skip to content

Commit

Permalink
fix: use larger recursive stack in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
orlp committed Apr 11, 2024
1 parent 05d980f commit 4aa91cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions py-polars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ numpy = { version = "0.20", default-features = false }
once_cell = { workspace = true }
pyo3 = { workspace = true, features = ["abi3-py38", "extension-module", "multiple-pymethods"] }
pyo3-built = { version = "0.4", optional = true }
recursive = { workspace = true }
serde_json = { workspace = true, optional = true }
smartstring = { workspace = true }
thiserror = { workspace = true }
Expand Down
7 changes: 7 additions & 0 deletions py-polars/src/on_startup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ fn warning_function(msg: &str, warning: PolarsWarning) {
#[pyfunction]
pub fn __register_startup_deps() {
if !registry::is_object_builder_registered() {
// Stack frames can get really large in debug mode.
#[cfg(debug_assertions)]
{
recursive::set_minimum_stack_size(1024 * 1024);
recursive::set_stack_allocation_size(1024 * 1024 * 16);
}

// register object type builder
let object_builder = Box::new(|name: &str, capacity: usize| {
Box::new(ObjectChunkedBuilder::<ObjectValue>::new(name, capacity))
Expand Down

0 comments on commit 4aa91cb

Please sign in to comment.