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
.)
1) Clone and build WebKit | |
git clone https://github.com/WebKit/WebKit.git WebKit | |
cd WebKit | |
Tools/Scripts/build-webkit -cmakeargs="-DENABLE_WEBGPU_BY_DEFAULT=1" --debug | |
2) Run your app | |
__XPC_METAL_CAPTURE_ENABLED=1 Tools/Scripts/run-minibrowser --debug --url http://localhost:5000/index.html#/loaders/gsplat |
#import <Cocoa/Cocoa.h> | |
#import <MetalKit/MetalKit.h> | |
// | |
// Compile and run: | |
// | |
// clang -O2 -fobjc-arc metal-mouse-lag.m -framework AppKit -framework Metal -framework MetalKit | |
// ./a.out | |
// |
const std = @import("std"); | |
pub fn build(b: *std.Build) void { | |
// Standard target options allows the person running `zig build` to choose | |
// what target to build for. Here we do not override the defaults, which | |
// means any target is allowed, and the default is native. Other options | |
// for restricting supported target set are available. | |
const target = b.standardTargetOptions(.{}); | |
// Standard optimization options allow the person running `zig build` to select |
Minimal D3D11 reference implementation: An uncluttered Direct3D 11 setup + basic rendering primer and API familiarizer. Complete, runnable Windows application contained in a single function and laid out in a linear, step-by-step fashion that should be easy to follow from the code alone. ~200 LOC. No modern C++, OOP or (other) obscuring cruft. View on YouTube
#!/usr/bin/env python | |
import SimpleHTTPServer | |
class MyHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def end_headers(self): | |
self.send_my_headers() | |
SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self) | |
def send_my_headers(self): | |
self.send_header("Cache-Control", "no-cache, no-store, must-revalidate") |
#!/bin/bash | |
killall Xcode | |
xcrun -k | |
xcodebuild -alltargets clean | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* | |
open /Applications/Xcode.app |
@interface SREAGLContext : NSObject | |
+ (EAGLContext*)sharedContext; | |
+ (EAGLContext*)newContext: (EAGLRenderingAPI) api; | |
@end | |
@implementation SREAGLContext |
#!/usr/bin/env ruby -w | |
class String | |
def starts_with?(prefix) | |
prefix.respond_to?(:to_str) && self[0, prefix.length] == prefix | |
end | |
end | |
HEADER_REGEX = /^#import\s+["<](.*)[">]/ |