Implement hash map for mj_name2id using djb2 and linear probing.

PiperOrigin-RevId: 499485127
Change-Id: I5aed6549db18b92d7c8a3b7590e50a00ce13a439
This commit is contained in:
Kyle Bayes
2023-01-04 07:57:11 -08:00
committed by Copybara-Service
parent 5261cceb30
commit f1007df013
11 changed files with 404 additions and 106 deletions
+3
View File
@@ -438,6 +438,9 @@ mjModel* mj_makeModel(int nq, int nv, int nu, int na, int nbody, int njnt,
m->nuser_actuator = nuser_actuator;
m->nuser_sensor = nuser_sensor;
m->nnames = nnames;
m->nnames_map = nbody + njnt + ngeom + nsite + ncam + nlight + nmesh + nskin
+ nhfield + ntex + nmat + npair + nexclude + neq + ntendon
+ nu + nsensor + nnumeric + ntext + ntuple + nkey + nplugin;
#define X(name) \
if ((m->name) < 0) { \