зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1395509
- Track malloc memory used by FileObject objects r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D34555
This commit is contained in:
Родитель
3c03c2b472
Коммит
ed1eaee129
|
@ -108,7 +108,8 @@ enum class ZealMode {
|
|||
_(BaselineScript) \
|
||||
_(IonScript) \
|
||||
_(ArgumentsData) \
|
||||
_(RareArgumentsData)
|
||||
_(RareArgumentsData) \
|
||||
_(FileObjectFile)
|
||||
|
||||
#define JS_FOR_EACH_MEMORY_USE(_) \
|
||||
JS_FOR_EACH_PUBLIC_MEMORY_USE(_) \
|
||||
|
|
|
@ -433,9 +433,9 @@ class FileObject : public NativeObject {
|
|||
static void finalize(FreeOp* fop, JSObject* obj) {
|
||||
FileObject* fileObj = &obj->as<FileObject>();
|
||||
RCFile* file = fileObj->rcFile();
|
||||
RemoveCellMemory(obj, sizeof(*file), MemoryUse::FileObjectFile);
|
||||
if (file->release()) {
|
||||
fileObj->setRCFile(nullptr);
|
||||
fop->delete_(file);
|
||||
fop->delete_(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -458,7 +458,7 @@ class FileObject : public NativeObject {
|
|||
|
||||
private:
|
||||
void setRCFile(RCFile* file) {
|
||||
js::SetReservedSlot(this, FILE_SLOT, PrivateValue(file));
|
||||
InitReservedSlot(this, FILE_SLOT, file, MemoryUse::FileObjectFile);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче