Skip to content

Instantly share code, notes, and snippets.

View gist:d24f30cda7584ab23d4c
git log release-1.6.0..master | grep ^Author: | sed 's/ <.*//;s/^Author: //' | sort | uniq -c | sort -nr
View gist:fd3cefc626164f146988
cd ~/darktable/build/ && rm -rf * && LDFLAGS="-fsanitize=address -fno-omit-frame-pointer" CFLAGS="-fsanitize=address -fno-omit-frame-pointer" CXXFLAGS="-fsanitize=address -fno-omit-frame-pointer" CC=gcc CXX=g++ cmake -DUSE_OPENCL=OFF ../ && make -j9 && sudo make -j9 install && darktable
View gist:9f2829f31c53efc78c6e
dt_times_t start;
dt_get_times(&start);
dt_times_t end;
dt_get_times(&end);
printf("%f, %f\n", end.clock - start.clock, end.user - start.user);
View gist:3e7e0a6bb20264869bf0
(openSUSE build flags)
cd ~/darktable/build/ && rm -rf * && LDFLAGS="-fsanitize=address -fno-omit-frame-pointer" CFLAGS="-fsanitize=address -fno-omit-frame-pointer -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing" CXXFLAGS="-fsanitize=address -fno-omit-frame-pointer -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fno-strict-aliasing" CC=gcc CXX=g++ cmake -DUSE_OPENCL=OFF ../ && make -j9 && sudo make -j9 install && darktable
=================================================================
==30080==ERROR: AddressSanitizer: heap-use-after-free on address 0x62d0001b8400 at pc 0x7f1d7273397c bp 0x7f1d58b2ee50 sp 0x7f1d58b2ee48
READ of size 4 at 0x62d0001b8400 thread T5
#0 0x7f1d7273397b in dt_mipmap_cache_get_with_caller /home/lebedevri/darktable/src/common/mipmap_cache.c:649
#1 0x7f1d72711fd9 in dt_imageio_e
@LebedevRI
LebedevRI / empty_dt.sh
Created May 22, 2015
Start with empty DT each time
View empty_dt.sh
#!/bin/bash
rm -Rf /tmp/darktable_tmp
mkdir -p /tmp/darktable_tmp
darktable --library /tmp/darktable_tmp/library.db \
--configdir /tmp/darktable_tmp --cachedir /tmp/darktable_tmp \
--tmpdir /tmp/darktable_tmp --conf write_sidecar_files=FALSE $*
@LebedevRI
LebedevRI / gist:15fbc90c2fdd541cddea
Last active Feb 26, 2016
gcc fsanitize=address + stack-protector-strong
View gist:15fbc90c2fdd541cddea
cd ~/darktable/build/ && rm -rf * && LDFLAGS="-fno-omit-frame-pointer -fsanitize=address -fstack-protector-strong" CFLAGS="${LDFLAGS}" CXXFLAGS="${LDFLAGS}" CPPFLAGS="${LDFLAGS}" CC=gcc CXX=g++ cmake ../ && make -j9 && sudo make -j9 install && darktable
View colorout-math.c
/*
* $ rm a.out; gcc -Wall -lm -O3 -fopenmp main.c && time ./a.out
*/
#include <stdio.h> // for printf
#include <string.h>
#include <math.h>
#include <xmmintrin.h> // for __m128, _mm_mul_ps, _mm_set1_ps, _mm_add_ps
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
View cbrtf.c
/*
* $ rm a.out; gcc -Wall -lm -O3 -fopenmp main.c && time ./a.out
*/
#include <stdio.h> // for printf
#include <string.h>
#include <math.h>
#include <xmmintrin.h> // for __m128, _mm_mul_ps, _mm_set1_ps, _mm_add_ps
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
View colorin-math.c
/*
* $ rm a.out; gcc -Wall -lm -O3 -fopenmp main.c && time ./a.out
*/
#include <stdio.h> // for printf
#include <string.h>
#include <math.h>
#include <xmmintrin.h> // for __m128, _mm_mul_ps, _mm_set1_ps, _mm_add_ps
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
View raspi2-gcc-defines.txt
#define __DBL_MIN_EXP__ (-1021)
#define __HQ_FBIT__ 15
#define __UINT_LEAST16_MAX__ 65535
#define __ARM_SIZEOF_WCHAR_T 32
#define __ATOMIC_ACQUIRE 2
#define __SFRACT_IBIT__ 0
#define __FLT_MIN__ 1.1754943508222875e-38F
#define __GCC_IEC_559_COMPLEX 2
#define __UFRACT_MAX__ 0XFFFFP-16UR
#define __UINT_LEAST8_TYPE__ unsigned char