Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 157435 Details for
Bug 287907
Indexer holds exclusive index lock for too long
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Clear result cache only once per Ist-translation unit
287907.txt (text/plain), 5.11 KB, created by
Markus Schorn
on 2010-01-27 13:09:02 EST
(
hide
)
Description:
Clear result cache only once per Ist-translation unit
Filename:
MIME Type:
Creator:
Markus Schorn
Created:
2010-01-27 13:09:02 EST
Size:
5.11 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.cdt.core >Index: parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java,v >retrieving revision 1.84 >diff -u -r1.84 PDOMCPPClassType.java >--- parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java 11 Oct 2009 06:24:18 -0000 1.84 >+++ parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassType.java 27 Oct 2009 14:40:07 -0000 >@@ -119,10 +119,10 @@ > } > > @Override >- public void addChild(PDOMNode member) throws CoreException { >- getPDOM().removeCachedResult(record + PDOMCPPLinkage.CACHE_MEMBERS); >+ public final void addChild(PDOMNode member) throws CoreException { > PDOMNodeLinkedList list = new PDOMNodeLinkedList(getLinkage(), record + MEMBERLIST); > list.addMember(member); >+ PDOMCPPClassScope.updateCache(this, member); > } > > @Override >Index: parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassScope.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.cdt-core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassScope.java,v >retrieving revision 1.10 >diff -u -r1.10 PDOMCPPClassScope.java >--- parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassScope.java 2 Jul 2009 08:57:38 -0000 1.10 >+++ parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassScope.java 27 Oct 2009 14:40:07 -0000 >@@ -50,12 +50,42 @@ > import org.eclipse.cdt.internal.core.pdom.PDOM; > import org.eclipse.cdt.internal.core.pdom.dom.BindingCollector; > import org.eclipse.cdt.internal.core.pdom.dom.PDOMBinding; >+import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode; > import org.eclipse.core.runtime.CoreException; > > /** > * Represents the class scope for a class stored in the index. > */ > class PDOMCPPClassScope implements ICPPClassScope, IIndexScope { >+ private static final class PopulateMap implements IPDOMVisitor { >+ private final CharArrayMap<List<PDOMBinding>> fResult; >+ private PopulateMap(CharArrayMap<List<PDOMBinding>> result) { >+ fResult = result; >+ } >+ >+ public boolean visit(IPDOMNode node) throws CoreException { >+ if (node instanceof PDOMBinding) { >+ final PDOMBinding binding= (PDOMBinding) node; >+ final char[] nchars = binding.getNameCharArray(); >+ List<PDOMBinding> list= fResult.get(nchars); >+ if (list == null) { >+ list= new ArrayList<PDOMBinding>(); >+ fResult.put(nchars, list); >+ } >+ list.add(binding); >+ try { >+ if (binding instanceof ICompositeType && ((ICompositeType) binding).isAnonymous()) { >+ return true; // visit children >+ } >+ } catch (DOMException e) { >+ } >+ } >+ return false; >+ } >+ >+ public void leave(IPDOMNode node){} >+ } >+ > private static final IndexFilter CONVERSION_FILTER = new DeclaredBindingsFilter(ILinkage.CPP_LINKAGE_ID, true, false) { > @Override > public boolean acceptBinding(IBinding binding) throws CoreException { >@@ -186,6 +216,19 @@ > } > } > >+ public static void updateCache(IPDOMCPPClassType ct, PDOMNode member) throws CoreException { >+ if (member instanceof PDOMBinding) { >+ final Long key= ct.getRecord() + PDOMCPPLinkage.CACHE_MEMBERS; >+ final PDOM pdom = ct.getPDOM(); >+ @SuppressWarnings("unchecked") >+ Reference<CharArrayMap<List<PDOMBinding>>> cached= (Reference<CharArrayMap<List<PDOMBinding>>>) pdom.getCachedResult(key); >+ CharArrayMap<List<PDOMBinding>> map= cached == null ? null : cached.get(); >+ if (map != null) { >+ new PopulateMap(map).visit(member); >+ } >+ } >+ } >+ > public static CharArrayMap<List<PDOMBinding>> getBindingMap(IPDOMCPPClassType ct) throws CoreException { > final Long key= ct.getRecord() + PDOMCPPLinkage.CACHE_MEMBERS; > final PDOM pdom = ct.getPDOM(); >@@ -195,34 +238,10 @@ > > if (map == null) { > // there is no cache, build it: >- final CharArrayMap<List<PDOMBinding>> result= new CharArrayMap<List<PDOMBinding>>(); >- IPDOMVisitor visitor= new IPDOMVisitor() { >- public boolean visit(IPDOMNode node) throws CoreException { >- if (node instanceof PDOMBinding) { >- final PDOMBinding binding= (PDOMBinding) node; >- final char[] nchars = binding.getNameCharArray(); >- List<PDOMBinding> list= result.get(nchars); >- if (list == null) { >- list= new ArrayList<PDOMBinding>(); >- result.put(nchars, list); >- } >- list.add(binding); >- >- try { >- if (binding instanceof ICompositeType && ((ICompositeType) binding).isAnonymous()) { >- return true; // visit children >- } >- } catch (DOMException e) { >- } >- } >- return false; >- } >- public void leave(IPDOMNode node){} >- }; >- >+ map= new CharArrayMap<List<PDOMBinding>>(); >+ IPDOMVisitor visitor= new PopulateMap(map); > visitor.visit(ct); > ct.acceptUncached(visitor); >- map= result; > pdom.putCachedResult(key, new SoftReference<CharArrayMap<?>>(map)); > } > return map;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 287907
:
149821
|
150451
|
150633
|
155176
|
155189
|
155709
|
156475
|
157044
|
157435
|
157438