This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Base.Test | |
@test totalsizeof(4) == sizeof(4) | |
@test totalsizeof(4.0) == sizeof(4.0) | |
@test totalsizeof("Test") == sizeof("Test") | |
@test totalsizeof('\t') == sizeof('\t') | |
@test totalsizeof(Nothing) == sizeof(Nothing) | |
# Array of Integer | |
a = [1,2,3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Totalsizeof | |
importall Base | |
export totalsizeof | |
# Helper: Pointer cache is used to break circular references in objects and avoid double countings | |
is_seen!(x, ptr_cache) = in(pointer_from_objref(x), ptr_cache) || (push!(ptr_cache, pointer_from_objref(x)); false) | |
# Helper: Catch types without size method | |
sizeof_catch(x) = try sizeof(x) catch 0 end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Heatmap</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.25.0"></script> | |
<style type="text/css"> | |
svg { | |
shape-rendering: crispEdges; | |
} |