Skip to content

test: fix pool size assumption #34554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/julia_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ void gc_sweep_sysimg(void);
static const int jl_gc_sizeclasses[] = {
#ifdef _P64
8,
#elif MAX_ALIGN == 8
// ARM and PowerPC have max alignment of 8,
#elif MAX_ALIGN > 4
// ARM and PowerPC have max alignment larger than pointer,
// make sure allocation of size 8 has that alignment.
4, 8,
#else
Expand Down
7 changes: 6 additions & 1 deletion test/cmdlineargs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,16 @@ let exename = `$(Base.julia_cmd()) --startup-file=no`
@test popfirst!(got) == " - function f(x)"
@test popfirst!(got) == " 80 []"
if Sys.WORD_SIZE == 64
# P64 pools with 64 bit tags
@test popfirst!(got) == " 32 Base.invokelatest(g, 0)"
@test popfirst!(got) == " 48 Base.invokelatest(g, x)"
else
elseif 12 == (() -> @allocated ccall(:jl_gc_allocobj, Ptr{Cvoid}, (Csize_t,), 8))()
# See if we have a 12-byte pool with 32 bit tags (MAX_ALIGN = 4)
@test popfirst!(got) == " 24 Base.invokelatest(g, 0)"
@test popfirst!(got) == " 36 Base.invokelatest(g, x)"
else # MAX_ALIGN >= 8
@test popfirst!(got) == " 16 Base.invokelatest(g, 0)"
@test popfirst!(got) == " 48 Base.invokelatest(g, x)"
end
@test popfirst!(got) == " 80 []"
@test popfirst!(got) == " - end"
Expand Down