Fix printing of GenericMemory
This makes it no longer error, a cleverer display can be worked out in the future.
This commit is contained in:
parent
7dbce9529e
commit
1305239f01
|
@ -87,6 +87,7 @@ function supertypeinfo(io::IO, type::Type)
|
|||
end
|
||||
|
||||
function memorylayout(io::IO, type::DataType)
|
||||
hassizeof(type) || return
|
||||
si = structinfo(type)
|
||||
!isempty(si) || return
|
||||
memstep = memstep = gcd((getfield.(si, :size), getfield.(si, :contentsize)) |>
|
||||
|
@ -95,7 +96,7 @@ function memorylayout(io::IO, type::DataType)
|
|||
bars = AnnotatedString[]
|
||||
descs = AnnotatedString[]
|
||||
for (; i, size, contentsize, ispointer) in si
|
||||
size == 0 && continue
|
||||
size <= 0 && continue
|
||||
color = FACE_CYCLE[i % length(FACE_CYCLE) + 1]
|
||||
width = max(2, memscale * size÷memstep)
|
||||
fsize, funits = humansize(size)
|
||||
|
|
|
@ -12,6 +12,7 @@ end
|
|||
|
||||
function hassizeof(type::Type)
|
||||
!isconcretetype(type) && return false
|
||||
type <: GenericMemory && return false
|
||||
type in (Symbol, String, Core.SimpleVector) && return false
|
||||
true
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue