Skip to content

Instantly share code, notes, and snippets.

@froydnj
froydnj / build.sh
Created July 21, 2010 00:23 — forked from ice799/build.sh
rm *.o test
as -a --gstabs --64 -march=core2 -o funcs64.o funcs64.S
gcc test.c -Wall -m64 -march=core2 -c
gcc funcs64.o test.o -Wall -m64 -march=core2 -o test
@froydnj
froydnj / export-patches
Created November 21, 2013 19:42
A small shell script for exporting Firefox patches from git repositories to hg ones.
#!/bin/bash
BUG=$(git branch | fgrep '*' | awk '{print $2}')
HG_REPO=
BUGZILLA_BUG=
TRY_PUSH=false
COMMIT_INBOUND=false
PRINT_TO_STDOUT=false
DONTBUILD_BECAUSE_NPOTB=false
REVIEWERS=
#!/bin/sh
MC_GDBINIT=${HOME}/src/mozilla-central-official/.gdbinit
if [ -f ${MC_GDBINIT} ]; then
COMMAND="--command=${MC_GDBINIT}"
fi
emacsclient -c -e "(gdb \"gdb ${COMMAND} --annotate=3 -q --args $*\")"
class LazyLogModule
{
public:
MOZ_CONSTEXPR LazyLogModule(const char* aLogName)
: mLogName(aLogName), mLog(nullptr)
{}
operator LogModule*()
{
// Carefully, atomically, instantiate a LogModule* if not already
#include <stdio.h>
class Table {
friend class Iterator;
public:
Table(int x, int y, int z, int w)
{
mArray[0] = x;
mArray[1] = y;
@froydnj
froydnj / includebloat.py
Created October 9, 2015 15:17
Python script for determining commonly used #include files
#!/usr/bin/env python
import collections
import os
import re
import subprocess
import sys
directory = sys.argv[1]
@froydnj
froydnj / latency.txt
Created December 28, 2015 14:16 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@froydnj
froydnj / clean-cargo-build.txt
Created August 28, 2017 20:39
cargo build on a completely pristine filesystem
froydnj@hawkeye:/opt/build/froydnj/build-icecc-mc$ RUST_LOG=cargo::ops::cargo_rustc::fingerprint=debug CARGOFLAGS=-v mach gtest -j1 XPCOM.\*
/usr/bin/make -C testing/gtest -j1 -s gtest
force-cargo-library-build
DEBUG:cargo::ops::cargo_rustc::fingerprint: fingerprint at: /opt/build/froydnj/build-icecc-mc/toolkit/library/x86_64-unknown-linux-gnu/release/.fingerprint/gkrust-gtest-252f56c7bc86e1d2/lib-gkrust_gtest-252f56c7bc86e1d2
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for gkrust-gtest v0.1.0 (file:///home/froydnj/src/gecko-dev.git/toolkit/library/gtest/rust): failed to read `/opt/build/froydnj/build-icecc-mc/toolkit/library/x86_64-unknown-linux-gnu/release/.fingerprint/gkrust-gtest-252f56c7bc86e1d2/lib-gkrust_gtest-252f56c7bc86e1d2`
INFO:cargo::ops::cargo_rustc::fingerprint: cause: failed to read `/opt/build/froydnj/build-icecc-mc/toolkit/library/x86_64-unknown-linux-gnu/release/.fingerprint/gkrust-gtest-252f56c7bc86e1d2/lib-gkrust_gtest-252f56c7bc86e1d2`
INFO:cargo::ops::cargo_rustc::fin
@froydnj
froydnj / expected-noop-build.txt
Created August 28, 2017 20:42
cargo build with no expected recompilation
froydnj@hawkeye:/opt/build/froydnj/build-icecc-mc$ RUST_LOG=cargo::ops::cargo_rustc::fingerprint=debug CARGOFLAGS=-v mach gtest -j1 XPCOM.\*
/usr/bin/make -C testing/gtest -j1 -s gtest
force-cargo-library-build
DEBUG:cargo::ops::cargo_rustc::fingerprint: fingerprint at: /opt/build/froydnj/build-icecc-mc/toolkit/library/x86_64-unknown-linux-gnu/release/.fingerprint/gkrust-gtest-252f56c7bc86e1d2/lib-gkrust_gtest-252f56c7bc86e1d2
INFO:cargo::ops::cargo_rustc::fingerprint: fingerprint error for gkrust-gtest v0.1.0 (file:///home/froydnj/src/gecko-dev.git/toolkit/library/gtest/rust): new (gkrust-shared v0.1.0 (file:///home/froydnj/src/gecko-dev.git/toolkit/library/rust/shared)) != old (gkrust-shared v0.1.0 (file:///home/froydnj/src/gecko-dev.git/toolkit/library/rust/shared))
INFO:cargo::ops::cargo_rustc::fingerprint: cause: new (gkrust-shared v0.1.0 (file:///home/froydnj/src/gecko-dev.git/toolkit/library/rust/shared)) != old (gkrust-shared v0.1.0 (file:///home/froydnj/src/gecko-dev.git/toolkit/library/rust/shared
This file has been truncated, but you can view the full file.
GECKO(12990) | ==12990== Warning: set address range perms: large range [0x1bf3949d2000, 0x1bf3d49d2000) (noaccess)
GECKO(12990) | ==12990== Invalid write of size 1
GECKO(12990) | ==12990== at 0x40632C: memset (string3.h:90)
GECKO(12990) | ==12990== by 0x40632C: ApplyZeroOrJunk(void*, unsigned long) (mozjemalloc.cpp:1323)
GECKO(12990) | ==12990== by 0x40E067: arena_t::MallocSmall(unsigned long, bool) (mozjemalloc.cpp:2959)
GECKO(12990) | ==12990== by 0x40E2BA: BaseAllocator::malloc(unsigned long) (mozjemalloc.cpp:4136)
GECKO(12990) | ==12990== by 0x40E34A: Allocator<MozJemallocBase>::malloc(unsigned long) (malloc_decls.h:37)
GECKO(12990) | ==12990== by 0x97C4718: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
GECKO(12990) | ==12990== by 0x97DB922: g_slice_alloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)
GECKO(12990) | ==12990== by 0x97DBFBD: g_slice_alloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4800.2)