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 "c.h" | |
#include "_cgo_export.h" | |
#include <string.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
struct A* echo(void) { | |
const char* p = "hello world"; | |
GoString p2; | |
p2.p = (char*)p; |
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
package pipe | |
import ( | |
"fmt" | |
"net" | |
) | |
func ConnPipe(c1 net.Conn, c2 net.Conn) { | |
defer c1.Close() | |
defer c2.Close() |
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
-module(perm). | |
-export([main/1]). | |
iend(M, N, Level) -> | |
Room = N - Level, | |
M - Room. | |
for(S, E, F) when S =< E -> F(S), for(S + 1, E, F); | |
for(_, _, _) -> void. |
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
$ erlc processes.erl | |
$ erl -noshell -s processes test -s init stop | |
the max processes is 262144 | |
the proecess time is 2.0:3.57 | |
$ erl -noshell -s processes test2 100000 -s init stop | |
the max processes is 262144 | |
{"init terminating in do_boot",{system_limit,[{erlang,spawn,[erlang,apply,[#Fun<processes.2.26012808>,[]]],[]},{erlang,spawn,1,[]},{processes,for,3,[{file,"processes.erl"},{line,24}]},{processes,for,3,[{file,"processes.erl"},{line,24}]},{processes,max,1,[{file,"processes.erl"},{line,10}]},{init,start_it,1,[]},{init,start_em,1,[]}]}} | |
# program freeze here... | |
# Ctrl+C not work |
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
$ gcc -o test test.c -llua -lm -ldl | |
$ time ./test state | |
real 0m21.470s | |
user 0m20.472s | |
sys 0m0.980s | |
$ time ./test |
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
-- Copyright (C) Jinhua Luo | |
local ffi = require("ffi") | |
local timer = require("ljio.core.timer") | |
local epoll = require("ljio.core.epoll") | |
local add_timer = timer.add_timer | |
local tremove = table.remove | |
local tinsert = table.insert | |
local pairs = pairs |
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
-- Copyright (C) Jinhua Luo | |
local select = select | |
local type = type | |
local tostring = tostring | |
local ipairs = ipairs | |
local tinsert = table.insert | |
local tremove = table.remove | |
local tpool = {n = 0} |
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
https://github.com/kingluo/luajit.io/tree/tmp | |
[TRACE 1 init.lua:602 stitch string.gmatch_aux] | |
[TRACE 2 init.lua:602 stitch string.gmatch_aux] | |
[TRACE 3 init.lua:601 stitch string.gmatch] | |
[TRACE 4 init.lua:602 stitch string.gmatch_aux] | |
[TRACE 5 init.lua:602 -> 1] | |
[TRACE 6 (2/0) init.lua:602 -> 1] | |
fork worker pid=10381 | |
[TRACE 7 init.lua:158 loop] |
NewerOlder