Skip to content

Instantly share code, notes, and snippets.

diff --git a/autoload.cpp b/autoload.cpp
index c883f8b..12ae9db 100644
--- a/autoload.cpp
+++ b/autoload.cpp
@@ -3,15 +3,23 @@
The classes responsible for autoloading functions and completions.
*/
-#include "config.h"
#include "autoload.h"
@ridiculousfish
ridiculousfish / gist:3729531
Created September 15, 2012 20:06
A (buggy) thread safe set written in Go
package main
import (
"fmt"
)
type SetTest struct {
val string
result chan bool
}
getwcd can be slow.
```
Analysis of sampling fish (pid 17046) every 1 millisecond
Process: fish [17046]
Path: /usr/local/bin/fish
Load Address: 0x100000000
Identifier: fish
Version: ???
Code Type: X86-64
.globl _ZN10parse_ll_t11parse_errorE13parse_token_tPKwz
.align 16, 0x90
.type _ZN10parse_ll_t11parse_errorE13parse_token_tPKwz,@function
_ZN10parse_ll_t11parse_errorE13parse_token_tPKwz: # @_ZN10parse_ll_t11parse_errorE13parse_token_tPKwz
.cfi_startproc
.cfi_personality 3, __gxx_personality_v0
.Leh_func_begin40:
.cfi_lsda 3, .Lexception40
# BB#0:
pushq %r15
@ridiculousfish
ridiculousfish / gist:7017899
Last active December 25, 2015 18:09
clang UBSan test case fails at -O1 and above
#include <string>
struct obj1_t
{
std::string text;
int val;
};
struct obj2_t
{
vmmap fancy_fish
Virtual Memory Map of process 27219 (fancy_fish)
Output report format: 2.2 -- 64-bit process
==== Non-writable regions for process 27219
__TEXT 000000010393f000-0000000103a0f000 [ 832K] r-x/rwx SM=COW ...y/fancy_fish
__LINKEDIT 0000000103ca9000-0000000103e98000 [ 1980K] r--/rwx SM=COW ...y/fancy_fish
MALLOC (admin) 0000000103e98000-0000000103e99000 [ 4K] r--/rwx SM=ZER
MALLOC (admin) 0000000103e9a000-0000000103e9b000 [ 4K] ---/rwx SM=NUL
MALLOC (admin) 0000000103eb0000-0000000103eb2000 [ 8K] ---/rwx SM=NUL
#include <stdio.h>
#include <functional>
void func(std::function<void(void)> func) {
printf("func1\n");
}
template<typename ANYTHING>
static void foo() {
func([](){});
@ridiculousfish
ridiculousfish / SafeSet.m
Created June 26, 2012 09:22
A thread safe set written in Objective-C
#import <Foundation/Foundation.h>
@interface SafeSet : NSObject {
NSMutableSet *set;
dispatch_queue_t queue;
}
@end
@implementation SafeSet
@ridiculousfish
ridiculousfish / width.c
Created June 23, 2018 23:30
wcwidth of variation selector
#include <wchar.h>
#include <stdio.h>
#include <locale.h>
int main(void) {
char *loc = setlocale(LC_ALL, "");
printf("%s %d\n", loc, wcwidth(0xFE0F));
return 0;
}
#include <string>
#include <sys/types.h>
#include <pwd.h>
#include <uuid/uuid.h>
#include <vector>
#include <thread>
static size_t burn() {
size_t ret = 0;
setpwent();