Created
November 26, 2019 07:06
-
-
Save rumblefrog/ae7fb0898dd90c424a918dad841346af to your computer and use it in GitHub Desktop.
This file contains hidden or 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
RefPtr<SourceFile> | |
SourceManager::createFromBuffer(ReportingContext& cc, UniquePtr<char[]> buffer, uint32_t length) | |
{ | |
const char* path = "fish-glub-glub"; | |
Atom* atom = strings_.add(path); | |
AtomMap<RefPtr<SourceFile>>::Insert p = file_cache_.findForAdd(atom); | |
if (p.found()) | |
return p->value; | |
RefPtr<SourceFile> file = new SourceFile(buffer.take(), length, path); | |
file_cache_.add(p, atom, file); | |
return file; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment