Skip to content

Instantly share code, notes, and snippets.

View Leandros's full-sized avatar
🦀
Available for Rust contracting

Arvid Gerstmann Leandros

🦀
Available for Rust contracting
View GitHub Profile
@Leandros
Leandros / crash.md
Created October 14, 2016 17:28
remotery crash

Interestingly I'm als getting a crash while reloading the DLL in a very similar fashion, unfortunately it's crashing deep, deep into ntdll.dll

10/14 18:52:10.493 I/Unload DLL
25b8:1c60 @ 74231718 - LdrpProcessDetachNode - INFO: Uninitializing DLL "Y:\workspace\private\RealEngine\_out\bin\hotreload_13120937502133\rengine_hotreload.dll" (Init routine: 00007FF9749F131B)
25b8:1c60 @ 74231718 - LdrpUnloadNode - INFO: Unmapping DLL "Y:\workspace\private\RealEngine\_out\bin\hotreload_13120937502133\rengine_hotreload.dll"
25b8:1c60 @ 74231718 - LdrpProcessDetachNode - INFO: Uninitializing DLL "C:\WINDOWS\System32\WS2_32.dll" (Init routine: 00007FF98E378F60)
25b8:1c60 @ 74231718 - LdrpUnloadNode - INFO: Unmapping DLL "C:\WINDOWS\System32\WS2_32.dll"
25b8:1c60 @ 74231718 - LdrLoadDll - ENTER: DLL name: Y:\workspace\private\RealEngine\_out\bin\hotreload_13120937530493\rengine_hotreload.dll
25b8:1c60 @ 74231718 - LdrpLoadDllInternal - ENTER: DLL name: Y:\workspace\private\RealEngine\_out\bin\hotreload_13120937530493
@Leandros
Leandros / cmd.bat
Last active December 25, 2016 19:56
Build LLVM
# Normal Build
cmake -G "Visual Studio 14 Win64" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" -DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-windows-msvc" -DCMAKE_INSTALL_PREFIX=install ..
# Open Visual Studio, select Release press build on target "INSTALL"
# Build Docs
cmake -DLLVM_BUILD_DOCS=YES -DLLVM_ENABLE_DOXYGEN=YES -DLLVM_INSTALL_DOXYGEN_HTML_DIR=doxydoc -DLLVM_ENABLE_SPHINX=YES -DLLVM_INSTALL_SPHINX_HTML_DIR=sphinxdoc -DCMAKE_INSTALL_PREFIX=install ..
cmake --build . --target doxygen
# Build Manual
cd $LLVMROOT/docs
@Leandros
Leandros / test.sh
Last active February 16, 2017 22:43
-frewrite-includes bug in clang
#!/bin/sh -x
LLVM_BIN=/usr/bin
cat <<EOF > test.c
#include <stdatomic.h>
int main(void)
{
volatile atomic_long i = 0;
@Leandros
Leandros / OpenGL.xml
Last active February 17, 2017 08:39
macOS 10.11.5 OpenGL
<?xml version="1.0" encoding="UTF-8" ?>
<!-- http://www.realtech-vr.com/glview -->
<GLView version="4.4.2"><System>Mac OS X 10.11.5 (15F34)</System>
<Device>iMac17,1</Device>
<CPU>4,0 GHz Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz x 8</CPU>
<Vendor>ATI Technologies Inc.</Vendor>
<Version>4.1 ATI-1.42.11</Version>
<GLSLVersion>4.10</GLSLVersion>
<Renderer>AMD Radeon R9 M395 OpenGL Engine</Renderer>
<Extensions>GL_ARB_blend_func_extended GL_ARB_draw_buffers_blend GL_ARB_draw_indirect GL_ARB_ES2_compatibility GL_ARB_explicit_attrib_location GL_ARB_gpu_shader_fp64 GL_ARB_gpu_shader5 GL_ARB_instanced_arrays GL_ARB_internalformat_query GL_ARB_occlusion_query2 GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_shader_subroutine GL_ARB_shading_language_include GL_ARB_tessellation_shader GL_ARB_texture_buffer_object_rgb32 GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_texture_storage GL_ARB_texture_s
/* ... some code calling the function below ... */
static int
gui_mkdev(void)
{
struct gui_state *s = g_state->gui_state;
s->vshader = mem_calloc(sizeof(struct gfx_shader));
s->vshader->id = 0x1;
s->vshader->len = 20;
@Leandros
Leandros / main.c
Created February 20, 2017 09:12
Error Checking
int
foo_can_fail(void)
{
bar_t bar;
if (bar_init(&bar))
return 1;
if (bar_do_stuff(&bar))
@Leandros
Leandros / main.c
Last active December 3, 2018 12:01
Lua C preprocessor
/*
* Copyright (c) 2018 Arvid Gerstmann.
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
#include <stdio.h>
/*lua!
local func = [[
@Leandros
Leandros / tail.c
Created March 23, 2017 14:44
tail -1
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define BUF 4096
int main(int argc, char **argv)
{
FILE *f;
int i, n, nl;
@Leandros
Leandros / links.md
Last active January 23, 2025 19:15
Writing a Modern Rendering Engine
@Leandros
Leandros / probe.sh
Created April 30, 2017 11:04
probe.sh
#!/bin/bash
WORDS=$(cat /usr/share/dict/words)
IFS=$'\n'
LC_ALL=C
echo "" > domains.txt
for word in $WORDS; do
if [[ $word =~ ^[A-Za-z]{4,12}$ ]]; then