[gjs: 8/10] atoms: Make destructor explicit to prevent inlining



commit 56bbcca0690785aa09b58a9142138d5ee5e6b911
Author: Philip Chimento <philip chimento gmail com>
Date:   Tue Feb 5 23:01:13 2019 -0800

    atoms: Make destructor explicit to prevent inlining
    
    The GjsAtoms destructor is giant because it calls a JS::Heap destructor
    for every atom. If it is generated implicitly, then GCC complains about
    it being too big to inline. Providing an explicit destructor seems to
    prevent this warning.

 gjs/atoms.h | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/gjs/atoms.h b/gjs/atoms.h
index ed8e4fe7..9005e5ef 100644
--- a/gjs/atoms.h
+++ b/gjs/atoms.h
@@ -101,6 +101,7 @@ struct GjsSymbolAtom : GjsAtom {
 class GjsAtoms {
  public:
     explicit GjsAtoms(JSContext* cx) {}
+    ~GjsAtoms(void) {}  // prevents giant destructor from being inlined
     GJS_JSAPI_RETURN_CONVENTION bool init_atoms(JSContext* cx);
 
     void trace(JSTracer* trc);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]