Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.
You've got two main options:
// Compile and run with: | |
// | |
// gcc -O3 -march=native fast-strlen.c -lpthread -o fast-strlen | |
// && ./fast-strlen | |
// | |
// Use gcc because clang is too smart and optimizes away parts of the | |
// benchmark. Results on Xeon(R) CPU E5-2650 v4 @ 2.20GHz with gcc | |
// 9.4.0: | |
// | |
// Scanning 10 times over 4.00GB... |
#include "HashTable.h" | |
#include <stdio.h> // fprintf | |
#include <stdlib.h> // exit | |
#include <string.h> // memset | |
#include <stdint.h> // uint8_t | |
void* dmalloc(size_t size) { | |
void* p = malloc(size); | |
if (p == NULL) { |
Hello!
For this article we take Tensor as a N-dimensional array whose last two axes might be interpreted as Matrix and/or the last axis might be interpreted as Vector. For TLDR the result is here.
Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.
There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.
struct foo {
struct bar {
int x;