- Provide a guide for how and when to document lifetime and ownership in C
- Prevent bugs caused by wrong assumptions of API users
- Prevent having to read and understand the whole library code when the API user notices the lack of documentation.
- Make it more likely that library developers notice a change lifetime requirements. They should check if the documentation is still correct after their change.
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
// +build linux | |
package main | |
import ( | |
"flag" | |
"log" | |
"os" | |
"runtime" | |
"time" |
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
/* Sample file using the LLVM coding standard | |
http://llvm.org/docs/CodingStandards.html | |
General rules: | |
- Indents are two spaces. No tabs should be used anywhere. | |
- Each line must be at most 80 characters long. | |
- Use C-style comments when writing C code | |
- File names should be PascalCase.c |
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
# try: | |
grub-mkconfig -o /boot/grub/grub.cfg | |
# output error: | |
Generating grub configuration file ... | |
Found linux image: /boot/vmlinuz-linux-ck | |
Found initrd image: /boot/initramfs-linux-ck.img | |
Found Windows 8 (loader) on /dev/sda1 | |
error: out of memory. | |
error: syntax error. |
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
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */ | |
/* ========================================================================== | |
HTML5 display definitions | |
========================================================================== */ | |
/** | |
* Correct `block` display not defined in IE 8/9. | |
*/ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.2.min.js"></script> | |
<script type="text/javascript" src="jquery.tipsy.js"></script> | |
<link href="tipsy.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> | |
<div id="chart"></div> |