Each call to mach_thread_self
adds another MACH_PORT_RIGHT_SEND
refcount. For each call to mach_thread_self
, you need to call
mach_port_deallocate
on the result.
(This does not apply to mach_task_self
.)
#!/usr/bin/python3 | |
import sys,os,os.path,argparse | |
########################################################################## | |
########################################################################## | |
g_verbose=False | |
def pv(msg): | |
if g_verbose: |
# vim:foldmethod=marker | |
STD_CFLAGS:= | |
LDFLAGS:=-lstdc++ | |
######################################################################### | |
# | |
# Configuration section | |
# | |
# |
10REM>DETECTNULA | |
20MODE7 | |
30VDU23,0,8,&30,0;0;0; | |
40*FX9 | |
50*FX10 | |
60*FX151,32,16 | |
70*FX19 | |
80E%=FNTM | |
90REM 34=&22,68=&44 | |
100*FX151,34,68 |
// -*- mode:c; c-file-style: "GNU" -*- | |
/* This file is to be #include'd into any file that uses it. | |
* Everything's static, so no problem. | |
*/ | |
////////////////////////////////////////////////////////////////////////// | |
////////////////////////////////////////////////////////////////////////// | |
/* TODO |
;; Interactively invoke ido-goto-symbol in a buffer that imenu understands. | |
(defun tom/get-imenu-alist () | |
;; clean up old imenu data -- bit cheeky | |
(require 'imenu) | |
(imenu--menubar-select imenu--rescan-item) | |
(imenu--make-index-alist) | |
(let ((name-and-pos '())) | |
(cl-labels ((addsymbols (symbol-list) | |
(when (listp symbol-list) |
;; Interactively invoke tom/find-definition-of-elisp-symbol with point on an elisp symbol. | |
(defvar tom/find-definition-of-elisp-symbol-history '()) | |
(defvar tom/find-definition-of-elisp-symbol-old-marker nil) | |
(defun tom/find-definition-of-elisp-symbol-add-marker () | |
(when tom/find-definition-of-elisp-symbol-old-marker | |
(ring-insert find-tag-marker-ring tom/find-definition-of-elisp-symbol-old-marker) | |
(setq tom/find-definition-of-elisp-symbol-old-marker nil))) |
(defun solidity-mode-make-imenu-generic-expression () | |
(let* ((space "[[:space:]]+") | |
(maybe-space "[[:space:]]*") | |
(ident-group "\\([A-Za-z_][A-Za-z0-9_]*\\)") | |
(modifier (mapconcat 'identity | |
'("static" "native" "export" "ephemeral" "pinned" | |
"const" "property" "public" "protected" "private" | |
"abstract" "virtual" "override" "divergent") | |
"\\|")) | |
(modifiers (concat "\\(?:\\(?:" modifier "\\)" space "\\)*"))) |
////////////////////////////////////////////////////////////////////////// | |
////////////////////////////////////////////////////////////////////////// | |
// | |
// Read/Absolute | |
// | |
////////////////////////////////////////////////////////////////////////// | |
////////////////////////////////////////////////////////////////////////// | |
static void T1_R_ABS(M6502 *); | |
static void T2_R_ABS(M6502 *); |
I don't think there's any objectively good solution to this perennial annoyance, so this is just some random thing that tries to tick the specific boxes I want ticked: simple to look at in the debugger; few/no casts during use; easy interop with existing C arrays; OK performance in an unoptimised build.