Skip to content

Instantly share code, notes, and snippets.

@wjlafrance
Created May 17, 2012 00:24
Show Gist options
  • Save wjlafrance/2715144 to your computer and use it in GitHub Desktop.
Save wjlafrance/2715144 to your computer and use it in GitHub Desktop.
Memory management in C
void *malloc(size_t size);
Allocates size bytes of memory
void *calloc(size_t count, size_t size);
Allocate count times size
void *realloc(void *ptr, size_t size);
malloc's size, copies memory, frees old pointer
If the new size is the same as the old size, returns the old pointer
free(void *ptr);
Returns memory to the system
There is no reference counting!
----
Objective-C
Strict superset of C (all valid C is valid Objective-C)
Shuns the use of primitives (arrays are objects, numbers are wrapped in objects)
Not even close to as fast as C
----
Accelerate framework
BLAS - Basic Linear Algebra Subprograms
First published in 1979
Fortran - 5 character names!
http://www.netlib.org/blas/
http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms
ATLAS - Automatically Tuned Linear Algebra Software
"Portable BLAS"
http://en.wikipedia.org/wiki/Automatically_Tuned_Linear_Algebra_Software
LAPACK - Linear Algebra PACKage
http://www.netlib.org/lapack/
http://www.physics.orst.edu/~rubin/nacphy/lapack/
http://www. website where you can buy books that is named after a jungle .com/LAPACK-Users-Guide-Software-Environments/dp/0898714478
vImage - Image manipulation
vDSP - Digital Signal Processing
----
Why care about 1/10th of a second?
Processors are machines for turning electrons into heat
Cell phones have relatively poor batteries (especially the iPhone 4S, just saying..)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment