This file contains hidden or 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
commit 99ea7d9b3d64c51694b8cc35c6bd25b4945ab0c2 | |
Author: Benjamin Kramer <[email protected]> | |
Date: Wed Apr 25 12:39:50 2012 +0200 | |
X86: Turn cmovs into branches when profitable. | |
This came up when a change in block placement formed a cmov and slowed down a | |
hot loop by 50%: | |
ucomisd (%rdi), %xmm0 |
This file contains hidden or 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
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#ifdef __SSE2__ | |
#include <emmintrin.h> | |
#endif | |
static const char *SkipToNewline(const char *CurPtr, const char *BufferEnd) { | |
unsigned char C = *CurPtr; |
This file contains hidden or 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
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
const char *boyer_moore_horspool(const char *h, size_t hlen, | |
const char *n, size_t nlen) { | |
const unsigned char *haystack = (const unsigned char *)h; | |
const unsigned char *needle = (const unsigned char *)n; |
This file contains hidden or 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 D option quiet | |
pid$target::malloc:entry { | |
@size[probefunc] = sum(arg0); | |
@totalsize = sum(arg0); | |
@calls[probefunc] = count(); | |
@totalcalls = count(); | |
} | |
pid$target::calloc:entry { |
This file contains hidden or 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
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <unistd.h> | |
#ifndef BUFSIZ | |
#define BUFSIZ 1024 | |
#endif | |
int main(int argc, char *argv[]) { | |
if (argc < 2) |
This file contains hidden or 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 | |
use strict; | |
use warnings; | |
use File::Find; | |
use Digest::MD5; | |
my %files; | |
sub wanted { |
This file contains hidden or 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
#include <algorithm> | |
#include <iostream> | |
#include <map> | |
#include <string> | |
#include <utility> | |
#include <vector> | |
typedef std::map<const std::string, unsigned> map_t; | |
typedef std::pair<unsigned, const std::string*> pair_t; | |
typedef std::vector<pair_t> array_t; |
This file contains hidden or 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
#include <stdio.h> | |
#include <string.h> | |
#include <dirent.h> | |
#include <unistd.h> | |
int main(int argc, char *argv[]) { | |
DIR *dir; | |
unsigned long count = 0, unlinked = 0; | |
struct dirent *ent; | |
int ret; |
This file contains hidden or 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 | |
use warnings; | |
use strict; | |
use File::stat; | |
use File::Basename; | |
if (@ARGV == 0) { | |
print {*STDERR} "Usage: $0 infile outfile\n"; | |
print {*STDERR} "Usage: $0 indir outdir\n"; |
This file contains hidden or 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
/* Safari History.plist cleaner | |
* compile with: | |
* gcc historyclean.m -o historyclean | |
*/ | |
#import <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) { | |
if (argc != 3) { | |
fprintf(stderr, |