Skip to content

Instantly share code, notes, and snippets.

💭
Nix o'clock ...

degski

💭
Nix o'clock ...
  • On the beach
Block or report user

Report or block degski

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@degski
degski / mimalloc.h
Last active Jul 4, 2019
Auto-linking various library builds
View mimalloc.h
// MIT License
//
// Copyright (c) 2019 degski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@degski
degski / compile_mimalloc.cmd
Last active Jul 5, 2019
Compile mimalloc with clang/llvm, both with and without thin-lto, both standard and secure.
View compile_mimalloc.cmd
:: MIT License
::
:: Copyright (c) 2019 degski
::
:: Permission is hereby granted, free of charge, to any person obtaining a copy
:: of this software and associated documentation files (the "Software"), to deal
:: in the Software without restriction, including without limitation the rights
:: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
:: copies of the Software, and to permit persons to whom the Software is
@degski
degski / main.cpp
Created Jun 14, 2019
Vose Alias Method - discrete_distribution
View main.cpp
// MIT License
//
// Copyright (c) 2019 degski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@degski
degski / bug.cpp
Created May 6, 2019
Clang bug 38102
View bug.cpp
// MIT License
//
// Copyright (c) 2019 degski
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@degski
degski / stack-dump.txt
Last active May 6, 2019
Clang bug 41745-3
View stack-dump.txt
1>Stack dump:
1>0. Program arguments: C:\Program Files\LLVM\bin\clang-cl.exe -cc1 -triple x86_64-pc-windows-msvc19.16.27030 -emit-obj -mincremental-linker-compatible -disable-free -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -mthread-model posix -relaxed-aliasing -menable-no-infs -menable-no-nans -menable-unsafe-fp-math -fno-signed-zeros -mreassociate -freciprocal-math -fno-trapping-math -ffp-contract=fast -ffast-math -ffinite-math-only -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu haswell -mllvm -x86-asm-syntax=intel -D_MT -flto-visibility-public-std --dependent-lib=libcmt --dependent-lib=oldnames -stack-protector 2 -fcxx-exceptions -fexceptions -fexternc-nounwind -fms-volatile -fdefault-calling-conv=cdecl -fdiagnostics-format msvc -dwarf-column-info -momit-leaf-frame-pointer -ffunction-sections -coverage-notes-file Y:\REPOS\gmp_random\gmp_random\main.gcno -resource-dir C:\Program Files\LLVM\lib\clang\9.0.0 -I y:\vcpkg\installed\x64-windows-static\include -D WIN64 -D NDEBUG
@degski
degski / main-469827.sh
Created May 6, 2019
Clang bug 41745-2
View main-469827.sh
# Crash reproducer for clang version 9.0.0 (trunk)
# Driver args: "--driver-mode=cl" "-c" "-I" "y:\\vcpkg\\installed\\x64-windows-static\\include" "/nologo" "-Wall" "-Wno-error" "/diagnostics:classic" "/Ox" "/Oi" "-D" "WIN64" "-D" "NDEBUG" "-D" "_CONSOLE" "-D" "NOMINMAX" "-D" "MPPP_BUILD_STATIC_LIBRARY" "-D" "MPPP_STATIC" "-D" "MPPP_PUBLIC=" "-D" "_UNICODE" "-D" "UNICODE" "/EHsc" "/MT" "/GS" "-ffunction-sections" "/arch:AVX2" "-ffast-math" "/permissive-" "/std:c++17" "/FoY:\\REPOS\\gmp_random\\x64\\Release\\" "/Gd" "/TP" "-m64" "main.cpp"
# Original command: "C:\\Program Files\\LLVM\\bin\\clang-cl.exe" "-cc1" "-triple" "x86_64-pc-windows-msvc19.16.27030" "-emit-obj" "-mincremental-linker-compatible" "-disable-free" "-main-file-name" "main.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" "-relaxed-aliasing" "-menable-no-infs" "-menable-no-nans" "-menable-unsafe-fp-math" "-fno-signed-zeros" "-mreassociate" "-freciprocal-math" "-fno-trapping-math" "-ffp-contract=fast" "-ffast-math" "-ff
View main-469827.cpp
This file has been truncated, but you can view the full file.
# 1 "<built-in>"
# 1 "main.cpp"
#if 0 /* expanded by -frewrite-includes */
#include <cassert>
#endif /* expanded by -frewrite-includes */
# 2 "main.cpp"
# 1 "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\include\\cassert" 1 3
// cassert standard header
@degski
degski / main.cpp
Created Apr 24, 2019
LZ4 linear search versus binary search
View main.cpp
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <array>
#include <random>
#include <frozen/map.h>
#include <plf/plf_nanotimer.h>
View test_hexstring_to_int.cpp
#include <cassert>
#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cstring>
#include <iomanip>
#include <iostream>
@degski
degski / _clang-format
Last active Apr 8, 2019
Clang Format for C++
View _clang-format
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: 0
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowShortCaseLabelsOnASingleLine: true
You can’t perform that action at this time.