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 <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> |
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
[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: |
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
/* | |
* 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 |
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
{-# 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 |
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
/* | |
* 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. |
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 <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> |
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
#!/bin/bash | |
########################################################### | |
# This script generates a nested Table of Contents from a # | |
# markdown document's header tags. # | |
# https://github.com/leo-yuriev # | |
########################################################### | |
# DEFAULTS |
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
// 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 | |
// |
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 <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]; |
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
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 |