tractatus/pptx-env/lib/python3.12/site-packages/lxml/debug.pxi
TheFlow ac2db33732 fix(submissions): restructure Economist package and fix article display
- Create Economist SubmissionTracking package correctly:
  * mainArticle = full blog post content
  * coverLetter = 216-word SIR— letter
  * Links to blog post via blogPostId
- Archive 'Letter to The Economist' from blog posts (it's the cover letter)
- Fix date display on article cards (use published_at)
- Target publication already displaying via blue badge

Database changes:
- Make blogPostId optional in SubmissionTracking model
- Economist package ID: 68fa85ae49d4900e7f2ecd83
- Le Monde package ID: 68fa2abd2e6acd5691932150

Next: Enhanced modal with tabs, validation, export

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 08:47:42 +13:00

36 lines
1.1 KiB
Cython

@cython.final
@cython.internal
cdef class _MemDebug:
"""Debugging support for the memory allocation in libxml2.
"""
def bytes_used(self):
"""bytes_used(self)
Returns the total amount of memory (in bytes) currently used by libxml2.
Note that libxml2 constrains this value to a C int, which limits
the accuracy on 64 bit systems.
"""
return tree.xmlMemUsed()
def blocks_used(self):
"""blocks_used(self)
Returns the total number of memory blocks currently allocated by libxml2.
Note that libxml2 constrains this value to a C int, which limits
the accuracy on 64 bit systems.
"""
return tree.xmlMemBlocks()
def dict_size(self):
"""dict_size(self)
Returns the current size of the global name dictionary used by libxml2
for the current thread. Each thread has its own dictionary.
"""
c_dict = __GLOBAL_PARSER_CONTEXT._getThreadDict(NULL)
if c_dict is NULL:
raise MemoryError()
return tree.xmlDictSize(c_dict)
memory_debugger = _MemDebug()