Skip to content

Instantly share code, notes, and snippets.

View pmatos's full-sized avatar

Paulo Matos pmatos

View GitHub Profile
@pmatos
pmatos / f80.rkt
Created April 4, 2024 15:48
f80 to decimal conversion
#lang racket
(define one #x3fff8000000000000000)
(define two #x40008000000000000000)
(define three #x4000c000000000000000)
(define (fits-in-80bit? x)
(zero? (arithmetic-shift x -80)))
(define (sign x)
version: "3.7"
services:
runner:
image: pmatos/github-runner:latest
environment:
RUNNER_NAME: "arm64-ChezScheme-runner"
RUNNER_REPOSITORY_URL: ${RUNNER_REPOSITORY_URL}
GITHUB_ACCESS_TOKEN: ${GITHUB_ACCESS_TOKEN}
volumes:
#lang racket/base
(require xsmith
racr
xsmith/racr-convenience
racket/pretty
racket/random
racket/list
racket/class
racket/string
@pmatos
pmatos / push-github.sh
Created September 20, 2019 12:48
WebKit project is too large to push, or import to github in one go. Used this script to import it 500 hashes at a time.
#!/bin/sh
# Adjust the following variables as necessary
REMOTE=github
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BATCH_SIZE=500
# check if the branch exists on the remote
if git show-ref --quiet --verify refs/remotes/$REMOTE/$BRANCH; then
# if so, only push the commits that are not on the remote already
@pmatos
pmatos / jsc-memdump.patch
Created August 2, 2019 09:00
Enable memory footprint dump on JSC in Linux
diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp
index ead01e20b7a..fa69e09e84e 100644
--- a/Source/JavaScriptCore/jsc.cpp
+++ b/Source/JavaScriptCore/jsc.cpp
@@ -140,17 +140,46 @@
#if __has_include(<WebKitAdditions/MemoryFootprint.h>)
#include <WebKitAdditions/MemoryFootprint.h>
#else
+#include <unistd.h>
+#include <sys/resource.h>
FAILED: Source/JavaScriptCore/shell/CMakeFiles/testb3.dir/__/b3/testb3.cpp.o
/home/pmatos/installs/infer-linux64-v0.16.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang++ -DBUILDING_JSCONLY__ -DBUILDING_WITH_CMAKE=1 -DBUILDING_testb3 -DHAVE_CONFIG_H=1 -DSTATICALLY_LINKED_WITH_WTF -IDerivedSources/ForwardingHeaders -I. -I../../Source/JavaScriptCore -I../../Source/JavaScriptCore/API -I../../Source/JavaScriptCore/assembler -I../../Source/JavaScriptCore/b3 -I../../Source/JavaScriptCore/b3/air -I../../Source/JavaScriptCore/bindings -I../../Source/JavaScriptCore/builtins -I../../Source/JavaScriptCore/bytecode -I../../Source/JavaScriptCore/bytecompiler -I../../Source/JavaScriptCore/dfg -I../../Source/JavaScriptCore/disassembler -I../../Source/JavaScriptCore/disassembler/ARM64 -I../../Source/JavaScriptCore/disassembler/udis86 -I../../Source/JavaScriptCore/domjit -I../../Source/JavaScriptCore/ftl -I../../Source/JavaScriptCore/heap -I../../Source/JavaScriptCore/debugger -I../../Source/JavaScriptCore/inspecto
@pmatos
pmatos / contracts.rkt
Created August 1, 2019 06:26
Optional enable Racket Contracts
#lang racket/base
;; ---------------------------------------------------------------------------------------------------
(require (for-syntax racket/base racket/string)
racket/contract
racket/require-syntax racket/provide-syntax
racket/match
racket/list
syntax/parse/define
racket/struct-info)