Skip to content

Commit

Permalink
Merge pull request #18143 from JuliaLang/tb/is_memdbg
Browse files Browse the repository at this point in the history
Expose MEMDEBUG, and use it to fix the #14173 test
  • Loading branch information
maleadt committed Aug 20, 2016
1 parent b96de27 commit a22bb89
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 @@ -221,7 +221,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 a22bb89

Please sign in to comment.