Skip to content

Commit

Permalink
Fix sandesh compilation error in ubuntu 16.04
Browse files Browse the repository at this point in the history
Closes-Bug: #1638636

Fixing ubuntu1604 build break due to tbb mutex not being copyable or clonable.
Closes-Bug: 1670880

Remove conflict with linux uuid_t type
Partial-Bug: 1633387

Optimize sandesh C generated code
Remove thrift_protocol and thrift_transport layers and directly
copy to/from buffer and structures in generated code for read
and write. This results in 10 times improvement in binary encode
and decode.
Closes-Bug: 1604700

Change-Id: Id2ee27b8d8b8ad2c0b6b31245eeb6b92ce7e4a16
  • Loading branch information
Sundaresan Rajangam authored and vmahuli committed Jan 24, 2019
1 parent 0033f83 commit 7489c5e
Show file tree
Hide file tree
Showing 29 changed files with 2,198 additions and 1,450 deletions.
1,408 changes: 1,287 additions & 121 deletions compiler/generate/t_c_generator.cc

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions compiler/main.cc
Expand Up @@ -821,7 +821,7 @@ void validate_const_rec(std::string name, t_type* type, t_const_value* value) {
break;
case t_base_type::TYPE_UUID:
if (value->get_type() != t_const_value::CV_STRING) {
throw "type error: const \"" + name + "\" was declared as uuid_t";
throw "type error: const \"" + name + "\" was declared as ct_uuid_t";
}
break;
case t_base_type::TYPE_IPADDR:
Expand Down Expand Up @@ -1385,7 +1385,7 @@ int main(int argc, char** argv) {
g_type_ipv4 = new t_base_type("ipv4", t_base_type::TYPE_IPV4);
g_type_ipaddr = new t_base_type("ipaddr", t_base_type::TYPE_IPADDR);
g_type_xml = new t_base_type("xml", t_base_type::TYPE_XML);
g_type_uuid_t = new t_base_type("uuid_t", t_base_type::TYPE_UUID);
g_type_uuid_t = new t_base_type("ct_uuid_t", t_base_type::TYPE_UUID);
g_type_static_const_string = new t_base_type("static const string", t_base_type::TYPE_STATIC_CONST_STRING);
g_type_sandesh_system = new t_base_type("system", t_base_type::TYPE_SANDESH_SYSTEM);
g_type_sandesh_request = new t_base_type("request", t_base_type::TYPE_SANDESH_REQUEST);
Expand Down
2 changes: 1 addition & 1 deletion compiler/parse/t_base_type.h
Expand Up @@ -224,7 +224,7 @@ class t_base_type : public t_type {
case TYPE_IPV4 : return "ipv4"; break;
case TYPE_IPADDR : return "ipaddr"; break;
case TYPE_XML : return "xml"; break;
case TYPE_UUID : return "uuid_t"; break;
case TYPE_UUID : return "ct_uuid_t"; break;
case TYPE_STATIC_CONST_STRING :
return "static const string"; break;
case TYPE_SANDESH_SYSTEM : return "system"; break;
Expand Down
2 changes: 1 addition & 1 deletion compiler/sandeshl.ll
Expand Up @@ -160,7 +160,7 @@ format_str (%([1-9]$)?([+-]?[ -#0])?([1-9]+)?(\.[1-9]+)?(hh|h|l|ll|L|z|j|t)?(
"string" { return tok_string; }
"binary" { return tok_binary; }
"xml" { return tok_xml; }
"uuid_t" { return tok_uuid_t; }
"ct_uuid_t" { return tok_uuid_t; }
"slist" { return tok_slist; }
"senum" { return tok_senum; }
"map" { return tok_map; }
Expand Down
1 change: 0 additions & 1 deletion library/c/SConscript
Expand Up @@ -15,7 +15,6 @@ libsandeshc = env.Library(target = 'sandesh-c',
source = ['sandesh.c',
'protocol/thrift_protocol.c',
'protocol/thrift_binary_protocol.c',
'transport/thrift_transport.c',
'transport/thrift_memory_buffer.c',
'transport/thrift_fake_transport.c',
])
Expand Down

0 comments on commit 7489c5e

Please sign in to comment.