skip to Main Content

Javascript – Would event listeners prevent garbage collecting objects referenced in outer function scopes?

Let's assume I have the following code: (function () { const largeObject = provideSomeLargeObject(); const largeStaticListOfElements = document.querySelectorAll('span'); const someElementThatWillBeRemoved = document.getElementById('i-will-be-removed'); const elms = document.getElementsByClassName('click-me'); for (let i = 0; i < elms.length; ++i) { const anotherLargeObject = provideAnotherLargeObject();…

VIEW QUESTION

Ubuntu – custom allocator and std::map

Here's the code i'm able to compile with gcc: #include <iostream> #include <map> template <class T> class map_alloc { public: typedef std::size_t size_type; typedef std::ptrdiff_t difference_type; typedef T* pointer; typedef const T* const_pointer; typedef T& reference; typedef const T& const_reference;…

VIEW QUESTION
Back To Top
Search