This file contains hidden or 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
struct Foo { | |
int a; | |
int b; | |
int c; | |
int d; | |
int e; | |
int f; | |
int g; | |
int h; | |
}; |
This file contains hidden or 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
$cat test.cc | |
#include <sys/mman.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> |
This file contains hidden or 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
$ g++ -o test test.cc --std=c++11 && ./test | |
<blink_gc> | |
<allocated_objects> | |
<net> | |
<url_request_context> | |
<app_request, extensions, isolated_media> | |
<0x?> | |
<http_cache> | |
<http_network_session> | |
<sdch_manager> |
This file contains hidden or 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
#!/bin/bash | |
PKG="com.chrome.canary" | |
function write_proc_line { | |
LINE="$1" | |
TYPE=$(echo $LINE | cut -d, -f2) | |
PROC=$(echo $LINE | cut -d, -f3) | |
PID=$(echo $LINE | cut -d, -f4) | |
OOM_SCORE=$(adb shell cat /proc/$PID/oom_score) | |
OOM_ADJ=$(adb shell cat /proc/$PID/oom_adj) |
This file contains hidden or 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
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
struct Category { | |
const char *name; | |
uint8_t is_enabled; | |
}; | |
constexpr uint32_t N = 100; |
This file contains hidden or 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
context: crbug.com/708990 | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
struct Category { | |
const char *name; | |
uint8_t is_enabled; | |
}; |
This file contains hidden or 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
$ sudo cpupower frequency-set -g powersave | |
$ sudo sh -c "echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo | |
$ for cpu in /sys/devices/system/cpu/cpu*; do for p in $(seq 4); do sudo sh -c "echo 1 > $cpu/cpuidle/state$p/disable"; done; do | |
######################### | |
# F1, use data() directly | |
######################### | |
$ perf stat out/offlnx/ctest 1 | |
Performance counter stats for 'out/offlnx/ctest 1': |
This file contains hidden or 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
$ sudo cpupower frequency-set -g powersave | |
$ sudo sh -c "echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo | |
$ for cpu in /sys/devices/system/cpu/cpu*; do for p in $(seq 4); do sudo sh -c "echo 1 > $cpu/cpuidle/state$p/disable"; done; do | |
#################### | |
# Use emplace_back() | |
#################### | |
$ perf stat out/offlnx/ctest | |
tcmalloc: large alloc 1600000000 bytes == 0x349af33da000 @ |
This file contains hidden or 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
import zipfile, sys | |
zip = zipfile.ZipFile(sys.argv[1]) | |
for f in zip.infolist(): | |
# I have no idea about the +2 but observed experimentally that it gets us | |
# to the right place. | |
print('%-16x %-10d %s' % (f.header_offset + len(f.FileHeader()) + 2, f.compress_size, f.filename)) |
This file contains hidden or 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
const encoder = new TextEncoder('utf-8'); | |
const decoder = new TextDecoder('utf-8'); | |
const TAG_MASK = 0x3; | |
const TAG_INT32 = 0; | |
const TAG_FLOAT64 = 1; | |
const TAG_STRING = 2; | |
function encode(cells) { |