]> granicus.if.org Git - graphviz/commit
gxl2gv: replace custom 'slist' string stack with generic stack
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 5 Feb 2022 06:05:42 +0000 (17:05 +1100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 24 Apr 2022 23:35:09 +0000 (16:35 -0700)
commitbe7e79aacb33cc0597ff0b3ccba651933387517f
treefc39012b5634f7f6e1f737690d7d25ee6da8848a
parenta2666a200eaeb3982cd0f28d3f677ed4901cba3d
gxl2gv: replace custom 'slist' string stack with generic stack

Similar to previous changes to `gc` in 4e2875fd7376338259dcb3ccc8f029d58bdf22dd,
this replaces some duplicated functionality with the generic Graphviz stack
implementation. Apart from reducing code duplication and complexity, this
removes an unnecessary rounding of allocations. The prior code rounded up
`slist` allocations to `sizeof(void*)`, but `malloc` effectively does this
internally anyway. This also adds checks for allocation failures that were
previously missing.

Gitlab: #1793
cmd/tools/gxl2gv.c