diff libfdproto/dictionary.c @ 1121:ccbd1426e04a

Improve testmesg_stress to measure impact of loaded dictionary
author Sebastien Decugis <sdecugis@freediameter.net>
date Tue, 14 May 2013 15:27:28 +0800
parents 79dd22145f52
children 5c6e94202c64
line wrap: on
line diff
--- a/libfdproto/dictionary.c	Tue May 14 12:32:28 2013 +0800
+++ b/libfdproto/dictionary.c	Tue May 14 15:27:28 2013 +0800
@@ -1908,13 +1908,19 @@
 all_errors:
 	if (ret != 0) {
 		char * buf = NULL;
-		size_t len = 0;
+		size_t len = 0, offset=0;
 		
-		CHECK_MALLOC( dict_obj_info[CHECK_TYPE(type) ? type : 0].dump_data(&buf, &len, NULL, data) );
+		if (type == DICT_ENUMVAL) {
+			CHECK_MALLOC( dump_enumval_data ( &buf, &len, &offset, data, parent->data.type.type_base ));
+		} else {
+			CHECK_MALLOC( dict_obj_info[CHECK_TYPE(type) ? type : 0].dump_data(&buf, &len, &offset, data) );
+		}
+	
 		TRACE_DEBUG(INFO, "An error occurred while adding the following data in the dictionary: %s", buf);
 		
 		if (ret == EEXIST) {
-			CHECK_MALLOC( dump_object(&buf, &len, NULL, locref, 0, 0, 0) );
+			offset=0;
+			CHECK_MALLOC( dump_object(&buf, &len, &offset, locref, 0, 0, 0) );
 			TRACE_DEBUG(INFO, "Conflicting entry in the dictionary: %s", buf);
 		}
 		free(buf);
"Welcome to our mercurial repository"