diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-18 16:49:56 +0300 |
---|---|---|
committer | gengjiawen <technicalcute@gmail.com> | 2019-11-30 11:51:06 +0300 |
commit | 52a3e3560484ec3ad4479ef80d829f7c99d39e80 (patch) | |
tree | 550033e4de5f83add146bfccec15bd6dc70a2f9c /src/node_dir.cc | |
parent | 6c4cf862d0f17be7a4113d720567d3ce8f2d6fac (diff) |
src: clean up node_file.h
- Move inline functions into an `-inl.h` file
- Move override function definitions into `.cc` files
- Remove `using` statements from header files
- Make data fields of classes private
- Mark classes at the end of hierarchies as `final`
This is also partially being done in an attempt to avoid
a particular internal compiler error, see
https://github.com/nodejs/node/pull/30475#issuecomment-554740850
for details.
PR-URL: https://github.com/nodejs/node/pull/30530
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_dir.cc')
-rw-r--r-- | src/node_dir.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/node_dir.cc b/src/node_dir.cc index 9d145131beb..37285928fbd 100644 --- a/src/node_dir.cc +++ b/src/node_dir.cc @@ -1,10 +1,11 @@ #include "node_dir.h" +#include "node_file-inl.h" #include "node_process.h" +#include "memory_tracker-inl.h" #include "util.h" #include "tracing/trace_event.h" -#include "req_wrap-inl.h" #include "string_bytes.h" #include <fcntl.h> @@ -85,6 +86,10 @@ DirHandle::~DirHandle() { CHECK(closed_); // We have to be closed at the point } +void DirHandle::MemoryInfo(MemoryTracker* tracker) const { + tracker->TrackFieldWithSize("dir", sizeof(*dir_)); +} + // Close the directory handle if it hasn't already been closed. A process // warning will be emitted using a SetImmediate to avoid calling back to // JS during GC. If closing the fd fails at this point, a fatal exception |