Skip to content

Instantly share code, notes, and snippets.

namespace {
// Helper struct for manually walking the stack using stack frame pointers
struct StackFrame {
StackFrame* parentFrame;
void* returnAddress;
};
size_t walkNormalStack(
uintptr_t* addresses,
size_t maxAddresses,
#!/bin/bash -ex
CONTENTS=$(cat <<EOF
foo
bar
baz
EOF
)
sudo echo "$CONTENTS" > /tmp/my_file.txt
@kennyyu
kennyyu / gist:f49c3f5d09930d30f98c5f53fec520c6
Last active October 13, 2023 01:20
folly coro changes proof of concept
diff --git a/folly/folly/experimental/coro/Task.h b/folly/folly/experimental/coro/Task.h
--- a/folly/folly/experimental/coro/Task.h
+++ b/folly/folly/experimental/coro/Task.h
@@ -43,13 +43,37 @@
#include <folly/futures/Future.h>
#include <folly/io/async/Request.h>
#include <folly/lang/Assume.h>
+#include <folly/synchronization/SanitizeThread.h>
#include <folly/tracing/AsyncStack.h>
import random
from collections import deque
from dataclasses import dataclass
# Key is hour number
# 0 == midnight
# 1 == 1am, etc.
NUM_PATIENTS_PER_HOUR = {
4: 2,
5: 11,