Skip to content

Instantly share code, notes, and snippets.

View DamienCassou's full-sized avatar
🙂
happy

Damien Cassou DamienCassou

🙂
happy
  • finsit @ Wolters Kluwer
  • Brest, France
View GitHub Profile
@DamienCassou
DamienCassou / cpython_leaks.cocci
Created May 8, 2012 13:18
Coccinelle semantic patch to find misuses of PyDescr_NewMethod with respect to reference counters in cpython
@r exists@
local idexpression x;
expression e;
position p1,p2;
@@
x = PyDescr_NewMethod@p1(...)
... when != Py_INCREF(x)
when != Py_XINCREF(x)
when != Py_DECREF(x)
function nixos-cleanup-safe () {
df -h /
nix-collect-garbage
df -h /
sudo nix-store --optimise
df -h /
}
function nixos-garbage-add-root () {
sudo ln -s $1 /nix/var/nix/gcroots/
lsebot@forge-scm1:/home/groups/pharobooks/htdocs/PharoByExampleTwo-Eng$ ls -ld .
drwxrwsr-x 8 nobody_pharobooks pharobooks 12288 juil. 28 11:37 .
lsebot@forge-scm1:/home/groups/pharobooks/htdocs/PharoByExampleTwo-Eng$ ls -l .
total 24
drwxrwsr-x 2 nobody_pharobooks pharobooks 4096 janv. 3 2014 2014-01-03_14:08:01
drwxrwsr-x 2 nobody_pharobooks pharobooks 4096 janv. 3 2014 2014-01-03_14:47:42
drwxrwsr-x 2 nobody_pharobooks pharobooks 4096 janv. 20 2014 2014-01-20_09:28:41
drwxrwsr-x 2 nobody_pharobooks pharobooks 4096 janv. 20 2014 2014-01-20_10:29:42
drwxrwsr-x 2 nobody_pharobooks pharobooks 4096 févr. 1 17:08 2014-02-01_16:08:28
drwxrwsr-x 2 lsebot pharobooks 4096 juil. 28 11:10 2014-07-28_09:10:18