On Fri, Oct 18, 2024 at 04:14:24PM +0100, Gavin Smith wrote:
> On Thu, Oct 17, 2024 at 09:31:35PM +0200, Patrice Dumas wrote:
> > > > Could add the number of footnotes * 2 and the number of special units
> > > > (including special units not associated to a section/node).  And
> > > > sections number should be * 3 for contents and shortcontents targets.
> > > > 
> > > > Also maybe the buckets memory should be allocated to that same number,
> > > > (number of sections * 3 + number of headings + number of (nodes,
> > > > anchors, floats) + number of index entries + number of footnotes * 2
> > > > + number of special units) as we know in advance there there will be
> > > > this number of registered ids.
> > > 
> > > I've started the code for this, but as I am not familiar with the
> > > XS conversion code at all, it would take me some time to work out
> > > how to get all of this information.  I tried copying code from
> > > elsewhere to access self->document in html_converter_customize in
> > > html_prepare_converter.c, but this wasn't set yet.
> > 
> > Here is a proposal.  I think that the hash maps initializations should
> > better be done in html_prepare_conversion_units_targets, they should not
> > be used before.
> 
> That's great, thanks.  I've applied the changes for using the C hashmap
> implementation.

I removed the C++ implementation, but a further simplification would
be to remove the other two implementations (IDT_perl_hashmap and
IDF_string_list).  This would allow removing the enum ids_data_type
(values IDT_*) and the CONVF_* arguments, and the source and header
files for those two implementations.

Reply via email to