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
# GitHub workflow to merge commits > n-days from a work branch to trunk. | |
# | |
# this is a low-overhead workflow implementing a time lock intended to | |
# allow people to rebase on a work branch but avoid rebases on trunk. | |
# | |
# the workflow is scheduled to fast-forward the target branch to the | |
# most recent commit in the source branch that is older than n-days. | |
# | |
# if there is a commit older than n-days common to both branches, the | |
# action will do nothing. the action will error in the case of commits |
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
Dear All, | |
I am sharing a patch for ld.so to show relative addresses and add | |
justified output. The goal of this patch is to increase `ldd` readability: | |
- modify trace output to use relative addresses by default. | |
- add alternative trace output mode with left-justified addresses. | |
The relative addresses are composed by subtracting the ELF ehdr address | |
which makes the output constant under address space layout randomization. |
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
#!/bin/sh | |
T=$(mktemp fooXXXXXX) | |
echo $* | xxd -r -p - > ${T} | |
objdump -D -bbinary -mi386:x86-64 -Mintel ${T} | \ | |
sed -n '/<.data>:/{n;s/0://g p}' | |
rm -f ${T} |
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
diff --git a/include/mimalloc-internal.h b/include/mimalloc-internal.h | |
index 7160bc474a71..3970e35a2c25 100644 | |
--- a/include/mimalloc-internal.h | |
+++ b/include/mimalloc-internal.h | |
@@ -114,6 +114,8 @@ void _mi_heap_set_default_direct(mi_heap_t* heap); | |
// "stats.c" | |
void _mi_stats_done(mi_stats_t* stats); | |
+void _mi_hist_log(size_t size); | |
+void _mi_hist_dump(mi_output_fun* out); |
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
#!/usr/bin/perl | |
# | |
# usage ./ISO-6093-NR3.pl (relaxed|stric) <float> | |
# | |
# parse ISO 6093 floating point decimal representation NR3 | |
# | |
# 'relaxed' | |
# | |
# - prohibits missing decimal point. e.g. '1' ERROR | |
# - permits leading zeros on integer. e.g. '01.23e10' OK |
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
# | |
# clang modules-ts example | |
# | |
source = src | |
modules = build/modules | |
objects = build/objects | |
output = build/output | |
CXX = clang++ |
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
#pragma once | |
# Ticket Lock | |
# | |
# Ticket locks are fair spinlocks that order acccess on a first-in, | |
# first-out basis. The lock is composed of a head counter and a tail | |
# counter. The head counter indicates the ticket number of the current | |
# lock owner. The tail counter indicates the last issued ticket number. | |
# To acquire the lock, the acquiring thread atomically increments the | |
# tail counter to assign itself a ticket number. It then waits until |
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
/* | |
* atomic memory interlock latency benchmark (public domain) | |
* author: Michael Clark <michaeljclark@mac.com> | |
* c++ -pthread -O2 atomic_latency.cc -o atomic_latency | |
*/ | |
#include <cstdio> | |
#include <thread> | |
#include <atomic> | |
#include <chrono> |
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
/* | |
* PLEASE LICENSE 11/2020, John Smith <john.smith@example.com> | |
* | |
* All rights to this work are granted for all purposes, with exception of | |
* author's implied right of copyright to defend the free use of this work. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
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
// See LICENSE for license details. | |
#include <vector> | |
#include <atomic> | |
#include <thread> | |
#include <mutex> | |
#include <memory> | |
#include <functional> | |
#include <condition_variable> |