View ascii_wc_like_ghc.c
#include <errno.h> | |
#include <fcntl.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include <time.h> | |
#include <unistd.h> |
View wc.hs.lst
[1 of 1] Compiling Main ( wc.hs, wc.o ) | |
==================== Asm code ==================== | |
.section .data | |
.align 8 | |
.align 1 | |
.globl __stginit_main@main:Main | |
.type __stginit_main@main:Main, @object | |
__stginit_main@main:Main: |
View ascii_wc_avx2.c
/* | |
* zlib License, see https://en.wikipedia.org/wiki/Zlib_License | |
* | |
* Copyright (c) 2020 Leonid Yuriev <leo@yuriev.ru>, | |
* Simple portable optimized ASCII-only version of wc tool. | |
* Just for fun & | |
* https://en.wikipedia.org/wiki/The_Computer_Language_Benchmarks_Game | |
* | |
* This software is provided 'as-is', without any express or implied | |
* warranty. In no event will the authors be held liable for any damages |
View ascii_wc.hs
{-# LANGUAGE Strict #-} | |
{-# LANGUAGE RecordWildCards #-} | |
import qualified Data.ByteString as BS | |
import System.Environment | |
import System.IO.Posix.MMap | |
data State = State | |
{ bs :: Int | |
, ws :: Int |
View ascii_wc.c
/* | |
* zlib License, see https://en.wikipedia.org/wiki/Zlib_License | |
* | |
* Copyright (c) 2020 Leonid Yuriev <leo@yuriev.ru>, | |
* Simple portable optimized ASCII-only version of wc tool. | |
* Just for fun & https://en.wikipedia.org/wiki/The_Computer_Language_Benchmarks_Game | |
* | |
* This software is provided 'as-is', without any express or implied | |
* warranty. In no event will the authors be held liable for any damages | |
* arising from the use of this software. |
View naive_wc.c
#include <errno.h> | |
#include <fcntl.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/mman.h> | |
#include <time.h> | |
#include <unistd.h> |
View toc.sh
#!/bin/bash | |
########################################################### | |
# This script generates a nested Table of Contents from a # | |
# markdown document's header tags. # | |
# https://github.com/leo-yuriev # | |
########################################################### | |
# DEFAULTS |
View Windows_LockFileEx_WriteFile_Bug.cpp
// This testcase reproduce a multithread clash-bug | |
// between LockFileEx() and WriteFile(). | |
// | |
// The bug was discovered when testing | |
// https://github.com/leo-yuriev/libmdbx and https://github.com/PositiveTechnologies/libfpta | |
// (Ultra fast, compact, Embedded Database for tabular and semistructured data). | |
// | |
//-------------------------------------------------------- | |
// UPDATE 2018-02-02 | |
// |
View ly_random.c
#include <stdint.h> | |
static unsigned rnd_head, rnd_tail; | |
static uint32_t rnd_pool[64]; | |
static __inline | |
uint32_t random_poly (unsigned n) | |
{ | |
/* LY: доступ к ряду полинома через циклический буфер. */ | |
return rnd_pool [(rnd_tail + n) & 63]; |
View patch.diff
commit acaf1cd6b292c7b54f2d4861d12fedb2674bd8d3 | |
Author: Leo Yuriev <leo@yuriev.ru> | |
Date: 2016-04-14 22:12:37 +0300 | |
fix for modern kernels | |
diff --git a/src/vtsspp/module.c b/src/vtsspp/module.c | |
index 266becc..f662f89 100644 | |
--- a/src/vtsspp/module.c | |
+++ b/src/vtsspp/module.c |