Skip to content

Instantly share code, notes, and snippets.

View YoukouTenhouin's full-sized avatar

Youkou Tenhouin YoukouTenhouin

View GitHub Profile
#include "mempool.h"
#include <stdlib.h>
void
mempool_new(struct hmd_mempool *pool)
{
struct hmd_mempool_chunk *chunk;
chunk = malloc(sizeof(struct hmd_mempool_chunk));
chunk->prev = NULL;
@YoukouTenhouin
YoukouTenhouin / create_index.pl
Last active August 29, 2015 14:01
Simple code search
#!/usr/bin/env perl
use strict;
use warnings;
use Redis;
my @files = (<*.c>,<*.h>,<*.cc>,<*.hh>,<*.cpp>,<*.hpp>);
my $redis = Redis->new;
@YoukouTenhouin
YoukouTenhouin / heap.c
Last active August 29, 2015 14:03
A Simple Memory Allocator
/* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE */
/* Version 2, December 2004 */
/* Copyright (C) 2012 Chapaev <[email protected]> */
/* Everyone is permitted to copy and distribute verbatim or modifiedcopies of this license document, and changing it is allowed as longas the name is changed. */
/* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION */
/* 0. You just DO WHAT THE F**K YOU WANT TO. */
#include "heap.h"
#include "heap_ifce.h"
diff --git a/unix/zerrors_solaris_amd64.go b/unix/zerrors_solaris_amd64.go
index 46e054c..c5cfa8d 100644
--- a/unix/zerrors_solaris_amd64.go
+++ b/unix/zerrors_solaris_amd64.go
@@ -1,7 +1,7 @@
// mkerrors.sh -m64
// Code generated by the command above; see README.md. DO NOT EDIT.
-// +build amd64,solaris
+// +build amd64,illumos
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <arpa/inet.h>
@YoukouTenhouin
YoukouTenhouin / .gitignore
Created August 4, 2020 00:08 — forked from zolunx10/.gitignore
Rime用颜文字(及符号)字典. 个人都绑定到v键开头了, 请下载kaomoji*并酌情修改字典文件.dict.yaml; 另如果要在当前输入法中直接嵌入, 请参考luna_pinyin_simp.custom.yaml前半段修改您的输入法设置.
*
!.gitignore
!alternative.yaml
!*.custom.yaml
!kaomoji.*.yaml
@YoukouTenhouin
YoukouTenhouin / reuseport_test_udp_mc_client.c
Created December 29, 2020 17:07
SO_REUSEPORT with UDP multicast
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <arpa/inet.h>