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
.)
// | |
// FadeScrollView.swift | |
// | |
// Created by Luís Machado on 23/06/2017. | |
// Copyright © 2017 Luis Machado. All rights reserved. | |
// | |
import UIKit | |
class FadeScrollView: UIScrollView, UIScrollViewDelegate { |
require 'optimist' | |
require 'plist' | |
# Setups of source path mapping for the framework at framework_path, | |
# which has a dsym at dsym_path. It maps the source paths to the | |
# source_path root. Implementation borrowed from https://medium.com/@maxraskin/background-1b4b6a9c65be | |
def setup_dsym_source_mapping(framework_path, dsym_path, source_path) | |
binary_uuids = get_uuids_of_dwarf(framework_path) | |
dsym_uuids = get_uuids_of_dwarf(dsym_path) | |
verify_uuids(binary_uuids, dsym_uuids) |
SDK=/var/root/code/iPhoneOS7.1.sdk | |
CCPP=clang++ -isysroot $(SDK) | |
CC=clang -isysroot $(SDK) | |
all: cat cat.dylib | |
clean: | |
rm -f cat cat.dylib |
As of iOS 11/macOS High Sierra, and only including ones in Foundation and CoreFoundation | |
Strings: | |
_NSCFString - a CFStringRef or CFMutableStringRef. This is the most common type of string object currently. | |
- May have 8 bit (ASCII) or 16 bit (UTF-16) backing store | |
_NSCFConstantString - a compile time constant CFStringRef, like you'd get with @"foo" | |
- May also be generated by dynamic string creation if matches a string in a pre-baked table of common strings called the StringROM | |
NSBigMutableString - an NSString backed by a CFStorage (https://github.com/opensource-apple/CF/blob/master/CFStorage.h) for faster handling of very large strings | |
NSCheapMutableString - a very limited NSMutableString that allows for zero-copy initialization. Used in NSFileManager for temporarily wrapping stack buffers. |
SDK=/var/root/code/iPhoneOS7.1.sdk | |
CCPP=clang++ -isysroot $(SDK) | |
CC=clang -isysroot $(SDK) | |
all: cat cat.dylib | |
clean: | |
rm -f cat cat.dylib |
/* | |
* This is an example provided by Facebook are for non-commercial testing and | |
* evaluation purposes only. | |
* | |
* Facebook reserves all rights not expressly granted. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL | |
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN |
/// Observes a run loop to detect any stalling or blocking that occurs. | |
/// | |
/// This class is thread-safe. | |
@interface GHRunLoopWatchdog : NSObject | |
/// Initializes the receiver to watch the specified run loop, using a default | |
/// stalling threshold. | |
- (id)initWithRunLoop:(CFRunLoopRef)runLoop; | |
/// Initializes the receiver to detect when the specified run loop blocks for |
/* Copyright (C) 2002 by Jilles Tjoelker */ | |
/* revised by Zhihao Yuan, 2012 */ | |
#include <sys/types.h> | |
#include <sys/event.h> | |
#include <sys/time.h> | |
#include <err.h> | |
#include <fcntl.h> | |
#include <signal.h> |
void callEntryPointOfImage(char *path, int argc, char **argv) | |
{ | |
void *handle; | |
int (*binary_main)(int binary_argc, char **binary_argv); | |
char *error; | |
int err = 0; | |
printf("Loading %s…\n", path); | |
handle = dlopen (path, RTLD_LAZY); |