15.01.2015 Views

Hacking Mac OS X - Black Hat

Hacking Mac OS X - Black Hat

Hacking Mac OS X - Black Hat

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Allocation<br />

ArrayInstance::ArrayInstance(JSObject* prototype, unsigned<br />

initialLength)<br />

: JSObject(prototype)<br />

{<br />

unsigned initialCapacity = min(initialLength, sparseArrayCutoff);<br />

m_length = initialLength;<br />

m_vectorLength = initialCapacity;<br />

m_storage =<br />

static_cast(fastZeroedMalloc(storageSize(initialCapaci<br />

ty)));<br />

Collector::reportExtraMemoryCost(initialCapacity *<br />

sizeof(JSValue*));<br />

}

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!