Skip to content

Commit

Permalink
Expose MEMDEBUG, and use it to fix the JuliaLang#14173 test
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt authored and mfasi committed Sep 5, 2016
1 parent 68b636e commit af2b7e4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/intrinsics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ JL_DLLEXPORT uint32_t jl_get_LLVM_VERSION(void)
;
}

extern "C" JL_DLLEXPORT int8_t jl_is_memdebug() {
#ifdef MEMDEBUG
return true;
#else
return false;
#endif
}

/*
low-level intrinsics design: TODO: fix description below
functions like add_int expect unboxed values of matching bit-length.
Expand Down
3 changes: 2 additions & 1 deletion test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ module Tmp14173
A = randn(2000, 2000)
end
whos(IOBuffer(), Tmp14173) # warm up
@test @allocated(whos(IOBuffer(), Tmp14173)) < 10000
const MEMDEBUG = ccall(:jl_is_memdebug, Bool, ())
@test @allocated(whos(IOBuffer(), Tmp14173)) < (MEMDEBUG ? 20000 : 8000)

## test conversion from UTF-8 to UTF-16 (for Windows APIs)

Expand Down

0 comments on commit af2b7e4

Please sign in to comment.