Skip to content

Instantly share code, notes, and snippets.

View iskakaushik's full-sized avatar

Kaushik Iska iskakaushik

View GitHub Profile

Keybase proof

I hereby claim:

  • I am iskakaushik on github.
  • I am iska (https://keybase.io/iska) on keybase.
  • I have a public key whose fingerprint is 6E87 C821 144D B40A 8B4D E7AA 6318 9237 908A BE06

To claim this, I am signing this object:

class Arena {
List<Thread> threads; // Threads that this arena is associated with
List<Chunk> chunks; // Chunks that this arena manages
Lock lock; // guard accesses to various things in this arena.
RBTree<Run> runsAvailClean; // let's talk about runs in a little bit.
// clean vs dirty = free zeroed data (calloc) vs free dirty data (malloc).
RBTree<Run> runsAvailDirty;
List<Bin> bins; // we will look at Bins soon.
}
class Arena {
List<Thread> threads; // Threads that this arena is associated with
List<Chunk> chunks; // Chunks that this arena manages
Lock lock; // guard accesses to various things in this arena.
RBTree<Run> runsAvailClean; // let's talk about runs in a little bit.
// clean vs dirty = free zeroed data (calloc) vs free dirty data (malloc).
RBTree<Run> runsAvailDirty;
List<Bin> bins; // we will look at Bins soon.
}
class Chunk {
Arena arena; // Arena that this chunk is associated with
boolean dirtied; // this is set if the chunk has ever been dirtied
List<Run> runs;
// metadata about free pages for a region size
RBTreeMultimap<RegionSize, Page> freePages;
}
enum RegionSize {
SM_2(2),
SM_4(4),
SM_8(8),
SM_20(20),
SM_40(40),
.
.
.
LARGE_2MB(2 * 1024 * 1024);
class Run {
Bin bin; // bins are further down in our discussion
RegionSize regionSize; // the region size for this run.
List<Page> pages; // pages that are a part of this run.
int numFreeRegions;
int totalNumRegions = pages.size() / regionSize;
boolean freeRegions[totalNumRegions]; // initially all set to true
// more metadata to quickly identify the first available region
}
class Bin {
RegionSize binRegionSize;
List<Run> runs;
Run currentRun; // current run of this bin
}
name city zip latitude longitude
wilby optical palo alto 94301 37.44192000000001 -122.14188000000001
deborahs palm palo alto 94301 37.45008668611999 -122.16012490336297
scandia home palo alto 94301 37.439011773629915 -122.15903442018154
archer income palo alto 94301 37.44547739819273 -122.16031641977904
sothebys international realty palo alto 94301 37.44265633306418 -122.15994234111085
rochelle ford metal sculptor palo alto 94301 37.442225034310475 -122.15209250463944
norwest venture partners palo alto 94301 37.4487871978415 -122.15927832038423
mirabelle jewelers palo alto 94301 37.44841299753496 -122.15676581670591
ace hardware palo alto 94301 37.440611098031866 -122.15912347499892
Place 1 Place 2 Reason
Emelina's Emelina's Peruvian Restaurant Large edit distance
Hillsdale Mall Levi's Outlet Hillsdale Mall Gap Outlet High string similarity but these differ in key terms.
San Francisco Airport San Francisco Airport Terminal - 1 Nested places are hard.
Central Park Central Park Cafe In New York City, near Central Park, These may well be different. In most other places, they are almost certainly the same.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
"name","wkt"
"Hillsdale Mall","POLYGON((-122.30062655184946 37.53862272401262,-122.30159214709482 37.539371367343186,-122.30232170794687 37.538826900211824,-122.30206421588144 37.53858869459169,-122.30240753863535 37.53834198082578,-122.3017316219636 37.537780491281076,-122.30180672381601 37.53756780474339,-122.30135611270151 37.53714242984815,-122.3010664341279 37.53715093736983,-122.29973605845652 37.53600241316314,-122.29934982035837 37.53598539785674,-122.29795507167063 37.5370658621093,-122.30010083888254 37.538928988101794,-122.30062655184946 37.53862272401262))"
"99 Ranch Mall - Milpitas","POLYGON((-121.91881917933222 37.42364933052066,-121.91771410921808 37.42397310706446,-121.91720985392328 37.42377713721835,-121.91687726000544 37.423206265612926,-121.91661976794 37.42328295011149,-121.91623352984186 37.42266947192397,-121.91650175074335 37.4225587044933,-121.9157626503088 37.421409801367815,-121.91578410798093 37.420847432486816,-121.91685571711554 37.42039327456982,-121.91712393801703 37.4207511483