This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Context<'a> { | |
bytes_pool: Vec<Vec<u8>>, | |
symbols: Vec<Symbol<'a>>, | |
} | |
#[allow(dead_code)] | |
struct Symbol<'a> { | |
name: &'a str, | |
is_defined: bool | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# THe following are intermittent LLD crashes that we ran into. They seem to be due to the thread's stack overflowing. | |
# We came up with this hypothesis because increasing the pthread's stack size seems to fix these or us: | |
# Patch: https://gist.github.com/tapthaker/e9fef745c84f7663731c6ae285991aca | |
Stack dump: | |
0. Program arguments: /private/var/tmp/_bazel_ios/execroot/__main__/external/lld_archive/ld64.lld @/var/folders/gm/w0c7fl0j3jn8dkxvllqdr8k00000gn/T/response-b9041c.txt | |
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it): | |
0 ld64.lld 0x000000010d337efa llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 42 | |
1 ld64.lld 0x000000010d336c38 llvm::sys::RunSignalHandlers() + 248 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/llvm/lib/Support/Threading.cpp b/llvm/lib/Support/Threading.cpp | |
index 04a1a9e19428..4198142ff0c6 100644 | |
--- a/llvm/lib/Support/Threading.cpp | |
+++ b/llvm/lib/Support/Threading.cpp | |
@@ -87,7 +87,7 @@ unsigned llvm::ThreadPoolStrategy::compute_thread_count() const { | |
// which is not enough for some/many normal LLVM compilations. This implements | |
// the same interface as std::thread but requests the same stack size as the | |
// main thread (8MB) before creation. | |
-const llvm::Optional<unsigned> llvm::thread::DefaultStackSize = 8 * 1024 * 1024; | |
+const llvm::Optional<unsigned> llvm::thread::DefaultStackSize = 256 * 1024 * 1024; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(assign_expr type='()' location=member_assignments_capturing_self.swift:8:9 range=[member_assignments_capturing_self.swift:8:5 - line:8:11] | |
(declref_expr type='@lvalue () -> ()' location=member_assignments_capturing_self.swift:8:5 range=[member_assignments_capturing_self.swift:8:5 - line:8:5] decl=member_assignments_capturing_self.(file).bar@member_assignments_capturing_self.swift:1:5 function_ref=unapplied) | |
(dot_syntax_call_expr implicit type='() -> ()' location=member_assignments_capturing_self.swift:8:11 range=[member_assignments_capturing_self.swift:8:11 - line:8:11] nothrow | |
(autoclosure_expr implicit type='(Foo) -> () -> ()' location=member_assignments_capturing_self.swift:8:11 range=[member_assignments_capturing_self.swift:8:11 - line:8:11] discriminator=0 escaping | |
(parameter_list | |
(parameter "self" type='Foo' interface type='Foo')) | |
(autoclosure_expr implicit type='() -> ()' location=member_assignments_capturing_self.swift:8:11 range=[member_assignments_capturing_self.swift:8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bar: () -> () = {} | |
class Foo { | |
func baz() {} | |
init() { | |
bar = baz // We oughta warn about capturing 'self' implicitly. | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo { | |
var bar: (() -> ())? | |
let x = 1 | |
init() { | |
bar = { | |
print(x) # Fix it by changing this to: print(self.x) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
import os | |
import random | |
import string | |
import tempfile | |
import time | |
from multiprocessing import Pool | |
from multiprocessing import cpu_count |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import groovy.json.JsonSlurper | |
import groovy.json.JsonOutput | |
def requestTemplate = '{\r\n \"id\": \"123\",\r\n \"idTypeCode\": \"ABC\",\r\n \"priceTypeCode\": \"PQR\",\r\n \"alternateDrugIndicator\": \"Y\",\r\n \"asOfDate\": null,\r\n \"name\": null,\r\n \"labelName\": null,\r\n \"memberPriceQuote\": {\r\n \"identifiers\": [\r\n {\r\n \"memberId\": \"123\",\r\n \"memberIdTypeCode\": \"AMI\"\r\n }\r\n ],\r\n \"memberTypeCode\": \"CED\",\r\n \"accountId\": \"1412\",\r\n \"prescriberId\": \"1345\",\r\n \"pharmacyId\": \"9845\",\r\n \"supplyDayCount\": \"30\",\r\n \"externalTransactionId\": \"evertext1\"\r\n }\r\n}' | |
def slurper = new groovy.json.JsonSlurper() | |
def drugPriceRequests = [] | |
for(int i=0;i<2;i++) { | |
def drugPriceRequest = slurper.parseText(requestTemplate) | |
drugPriceRequest.id = i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Fbsimctl < Formula | |
desc 'A Command Line interface to FBSimulatorControl' | |
homepage 'https://github.com/facebook/FBSimulatorControl' | |
url 'https://github.com/facebook/FBSimulatorControl/archive/master.zip' | |
sha256 'b88b4dd1f24edc59a51023f80163b904a66554bfea636bdc4e830ba5b22c5942' | |
head 'https://github.com/facebook/FBSimulatorControl.git' | |
version '1.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSArray *fontFamilies = [UIFont familyNames]; | |
for (int i = 0; i < [fontFamilies count]; i++) | |
{ | |
NSString *fontFamily = [fontFamilies objectAtIndex:i]; | |
NSArray *fontNames = [UIFont fontNamesForFamilyName:[fontFamilies objectAtIndex:i]]; | |
NSLog (@"%@: %@", fontFamily, fontNames); | |
} |
NewerOlder