cpp: use a simple hash table instead of tab struct