Skip to content

Commit

Permalink
Fix for C stack checking issues on 1.1
Browse files Browse the repository at this point in the history
Fixes #289.
  • Loading branch information
simonbyrne committed Jan 17, 2019
1 parent 06a877d commit b546e64
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion appveyor.yml → .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
environment:
matrix:
- julia_version: 1
- julia_version: 1.0
- julia_version: 1.1
- julia_version: nightly

platform:
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ os:
- osx
julia:
- 1.0
- 1.1
- nightly

matrix:
Expand Down
10 changes: 6 additions & 4 deletions src/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,12 @@ function initEmbeddedR()

# initialize library
argv = ["REmbeddedJulia","--silent","--no-save"]
i = ccall((:Rf_initEmbeddedR,libR),Cint,(Cint,Ptr{Ptr{Cchar}}),length(argv),argv)
if i == 0
error("Could not start embedded R session.")
end
ccall((:Rf_initialize_R,libR),Cint,(Cint,Ptr{Ptr{Cchar}}),length(argv),argv)
# Julia 1.1+ no longer loads libraries in the main thread
# TODO: this needs to be set correctly
# https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Threading-issues
unsafe_store!(cglobal((:R_CStackLimit,libR),Csize_t), typemax(Csize_t))
ccall((:setup_Rmainloop,libR),Cvoid,())

ptr_write_console_ex = @cfunction($write_console_ex,Nothing,(Ptr{UInt8},Cint,Cint)).ptr
unsafe_store!(cglobal((:ptr_R_WriteConsole,libR),Ptr{Cvoid}), C_NULL)
Expand Down

0 comments on commit b546e64

Please sign in to comment.