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
#include "fifo.h" | |
#define ENSURE(foo) do { assert((foo) == 0); } while (0) | |
fifo_queue* queue_init() | |
{ | |
fifo_queue *q = (fifo_queue*) malloc(sizeof(fifo_queue)); | |
q->front = NULL; | |
q->back = NULL; | |
ENSURE(pthread_mutex_init(&q->mutex, NULL)); |
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
describe "EM hooks" do | |
it "encodes outbound objects as JSON" do | |
$test_obj = { | |
"JSON Test Pattern pass3"=>{ | |
"The outermost value"=>"must be an object or array.", | |
"In this test"=>"It is an object." | |
} | |
} |
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
#include "ruby.h" | |
typedef struct em_data { | |
char *data; | |
unsigned long len; | |
} em_data; | |
typedef struct em_hooks { | |
void *arg; | |
void (*em_recv_data)(em_data *unit, void *arg); |
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
require 'eventmachine' | |
require 'testext' | |
module Server | |
def post_init | |
send_data "special test data" | |
end | |
end | |
hooks = EM::Hooks.new |
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/kernel/common/dir.rb b/kernel/common/dir.rb | |
index 312cffa..cf4d185 100644 | |
--- a/kernel/common/dir.rb | |
+++ b/kernel/common/dir.rb | |
@@ -373,19 +373,19 @@ class Dir | |
def self.chdir(path = ENV['HOME']) | |
if block_given? | |
original_path = self.getwd | |
- error = Platform::POSIX.chdir path | |
+ error = FFI::Platform::POSIX.chdir path |
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/ext/cmain.cpp b/ext/cmain.cpp | |
index a75417c..2922338 100644 | |
--- a/ext/cmain.cpp | |
+++ b/ext/cmain.cpp | |
@@ -783,12 +783,12 @@ extern "C" int evma_send_file_data_to_connection (const unsigned long binding, c | |
evma_start_proxy | |
*****************/ | |
-extern "C" void evma_start_proxy (const unsigned long from, const unsigned long to) | |
+extern "C" void evma_start_proxy (const unsigned long from, const unsigned long to, const unsigned long bufsize) |
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
cd /path/to/google-perftools-1.4 | |
patch -p0 < /path/to/mach64.diff | |
CFLAGS="-D_XOPEN_SOURCE" CXXFLAGS="-D_XOPEN_SOURCE" ./configure | |
make, make install, blah blah etc |
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
require "luarocks.require" | |
require "pack" | |
require "socket" | |
require "md5" | |
Growl = {version = 1, registration = 0, notification = 1} | |
function Growl.new(hostname, appname) | |
local mysock = assert(socket.udp()) |
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
#include <pthread.h> | |
#include <stdio.h> | |
#include <ruby.h> | |
#include "thrqueue.h" | |
static VALUE cThreadTest; | |
void *produce(struct Queue *q) | |
{ | |
char *ptr = "foo"; |
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/ext/rubymain.cpp b/ext/rubymain.cpp | |
index 892f0fd..f0cf588 100644 | |
--- a/ext/rubymain.cpp | |
+++ b/ext/rubymain.cpp | |
@@ -20,6 +20,7 @@ See the file COPYING for complete licensing information. | |
#include "project.h" | |
#include "eventmachine.h" | |
#include <ruby.h> | |
+#include <st.h> | |