summaryrefslogtreecommitdiff
path: root/include/openvswitch/shash.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-03-23 15:46:58 -0700
committerBen Pfaff <blp@ovn.org>2018-03-31 12:22:58 -0700
commit828129d9271da18c2742648aa910e1fe399bb8db (patch)
treeb6c38580b22179dc7c7efd4c030aed5b9ff89b38 /include/openvswitch/shash.h
parent056caea89bffe5f27000944c0ed5aaa6f7a2d852 (diff)
downloadopenvswitch-828129d9271da18c2742648aa910e1fe399bb8db.tar.gz
json: Avoid extra memory allocation and string copy parsing object members.
Until now, every time the JSON parser added an object member, it made an extra copy of the member name and then freed the original copy. This is wasteful, so this commit eliminates the extra copy. Signed-off-by: Ben Pfaff <blp@ovn.org> Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
Diffstat (limited to 'include/openvswitch/shash.h')
-rw-r--r--include/openvswitch/shash.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/openvswitch/shash.h b/include/openvswitch/shash.h
index afc482364..c249e13e1 100644
--- a/include/openvswitch/shash.h
+++ b/include/openvswitch/shash.h
@@ -62,6 +62,7 @@ struct shash_node *shash_add_nocopy(struct shash *, char *, const void *);
bool shash_add_once(struct shash *, const char *, const void *);
void shash_add_assert(struct shash *, const char *, const void *);
void *shash_replace(struct shash *, const char *, const void *data);
+void *shash_replace_nocopy(struct shash *, char *name, const void *data);
void shash_delete(struct shash *, struct shash_node *);
char *shash_steal(struct shash *, struct shash_node *);
struct shash_node *shash_find(const struct shash *, const char *);