uorb: reduce RAM usage by avoiding string copies

The lifetime of the string is guaranteed because we never delete
DeviceNode objects and the strings in question are already on the heap.

This frees roughly 2.2KB of RAM on Pixracer
This commit is contained in:
Beat Küng
2016-10-18 17:07:40 +02:00
committed by Lorenz Meier
parent 4da2ae2302
commit 1bdad65849
2 changed files with 24 additions and 19 deletions

View File

@@ -912,9 +912,9 @@ uORB::DeviceMaster::ioctl(device::file_t *filp, int cmd, unsigned long arg)
} else {
// add to the node map;.
#ifdef __PX4_NUTTX
_node_map.insert(nodepath, node);
_node_map.insert(devpath, node);
#else
_node_map[std::string(nodepath)] = node;
_node_map[std::string(devpath)] = node;
#endif
}