diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-12-24 14:00:40 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-12-24 14:00:40 +0000 |
commit | 59221c379641a8d3a180c8b0cca2022c763c2a6b (patch) | |
tree | 6c5d517b8524c16e1b33aaeea7477c395876ea30 /mdoc.h | |
parent | d1f1f8d600d26e5bb01736ad53269bed555043d5 (diff) | |
download | mandoc-59221c379641a8d3a180c8b0cca2022c763c2a6b.tar.gz mandoc-59221c379641a8d3a180c8b0cca2022c763c2a6b.tar.zst mandoc-59221c379641a8d3a180c8b0cca2022c763c2a6b.zip |
As per schwarze@'s suggestions, roll back the refcount structure in
favour of a simpler shim for normalised data in the node allocation and
free routines. This removes the need to bump and copy references within
validator handlers, removes a pointer redirect, and also kills the
refcount structure itself. Data is assumed to "live" either in a
MDOC_BLOCK or MDOC_ELEM and is copied accordingly.
Diffstat (limited to 'mdoc.h')
-rw-r--r-- | mdoc.h | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -1,4 +1,4 @@ -/* $Id: mdoc.h,v 1.109 2010/12/22 11:15:16 kristaps Exp $ */ +/* $Id: mdoc.h,v 1.110 2010/12/24 14:00:40 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -365,15 +365,6 @@ union mdoc_data { struct mdoc_bl Bl; }; -/* - * Reference-counted structure for containing normalised arguments of - * certain macros (those listed in union mdoc_data). - */ -struct mdoc_norm { - int refcnt; - union mdoc_data d; -}; - /* * Single node in tree-linked AST. */ @@ -396,7 +387,7 @@ struct mdoc_node { #define MDOC_ENDED (1 << 5) /* rendering has been ended */ enum mdoc_type type; /* AST node type */ enum mdoc_sec sec; /* current named section */ - struct mdoc_norm *norm; /* ref-counted, normalised args */ + union mdoc_data *norm; /* normalised args */ /* FIXME: these can be union'd to shave a few bytes. */ struct mdoc_arg *args; /* BLOCK/ELEM */ struct mdoc_node *pending; /* BLOCK */ |