hmap usage:

in include/openvswitch/shash.h, we have:

at first glance, it is a hmap encapsulated in shash.

In case we forget what is a hmap:

Obviously, it is the simplist hash map linked list. The mask means the max-hash value, the n means the total number of hashed members saved in hmap. Buckets[i] all have same hash value according to mask.

When we save key-value things, first put it in a shash_node, together with hmap_node inside it, push the hmap_node to the hmap hash linked list defined inside shash. When we search for search value of a key, gen key's hash and find in the hmap inside shash, get the hmap_node, CONTAINER_OF the hmap_node is the shash_node, then shash_node->name, shash_node->data is reachable.

OvS: data structure analysis的更多相关文章

  1. LRU implement Data Structure analysis

    三种数据结构实现的LRU对比分析: 自适应循环链表, 跳表 和 伸展树 对比发现 : 跳表比其他两个会好一些(命中率) 来自论文 Performance Analysis of LRU

  2. [LeetCode] All O`one Data Structure 全O(1)的数据结构

    Implement a data structure supporting the following operations: Inc(Key) - Inserts a new key with va ...

  3. [LeetCode] Add and Search Word - Data structure design 添加和查找单词-数据结构设计

    Design a data structure that supports the following two operations: void addWord(word) bool search(w ...

  4. [LeetCode] Two Sum III - Data structure design 两数之和之三 - 数据结构设计

    Design and implement a TwoSum class. It should support the following operations:add and find. add - ...

  5. Finger Trees: A Simple General-purpose Data Structure

    http://staff.city.ac.uk/~ross/papers/FingerTree.html Summary We present 2-3 finger trees, a function ...

  6. Mesh Data Structure in OpenCascade

    Mesh Data Structure in OpenCascade eryar@163.com 摘要Abstract:本文对网格数据结构作简要介绍,并结合使用OpenCascade中的数据结构,将网 ...

  7. ✡ leetcode 170. Two Sum III - Data structure design 设计two sum模式 --------- java

    Design and implement a TwoSum class. It should support the following operations: add and find. add - ...

  8. leetcode Add and Search Word - Data structure design

    我要在这里装个逼啦 class WordDictionary(object): def __init__(self): """ initialize your data ...

  9. Java for LeetCode 211 Add and Search Word - Data structure design

    Design a data structure that supports the following two operations: void addWord(word)bool search(wo ...

随机推荐

  1. [C++STDlib基础]关于单字符的操作——C++标准库头文件<cctype>

    网上实例 总结 /* _STD_BEGIN using _CSTD isalnum; using _CSTD isalpha; using _CSTD iscntrl; using _CSTD isd ...

  2. 内容中断随想录(risc cpu的那些事)

    发一下牢骚和主题无关: [ 声明:版权所有,欢送转载,请勿用于商业用途.  联系信箱:feixiaoxing @163.com] 从消费电子的soc芯片来讲,当初海内从事芯片设计的企业还是很多的,这其 ...

  3. Android便携式热点的开启状态检测和SSID的获取

    WIFI热点的开启状态和开启后的SSID如何获取呢? 打开WifiManager.java源码,可找到 getWifiApState() 方法,惊喜的发现直接调用这个方法就能获取到热点的状态,然而在调 ...

  4. ASP.NET CORE 1.0 初次接触

    vs2015 update3 升级后,可以创建asp.net core 1.0 的web应用了, 默认模版,发布到指定文件夹 服务器上需要安装 DotNetCore.1.0.0-WindowsHost ...

  5. 怎样在linux或者Unix上检查端口是否在使用

     英文原文链接:https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/ Question 1: 怎样在lin ...

  6. Java文档注释

    文档注释是用于生成API文档,API主要用于说明类.方法.成员变量 javadoc工具 处理文档源文件在类.接口.方法.成员变量.构造器和内部类之前的注释,忽略其他地方的文档注释.而且javadoc工 ...

  7. TMCache

    TMCache设计的目的是用于存储临时持久化对象的开源iOS/OS  key/value缓存类库,减少重复创建像下载数据.缓慢的处理结果这样的昂贵性能花销.TMCache由两个本身相似的存储组成,一个 ...

  8. trove datastore 浅析

    以下代码来自trove/datastore该目录下一共有4个文件__init__,views,models,service大概关系(主要是wsgi吧,没仔细学过,简单的从代码上做推测),service ...

  9. oc底层方法调用流程

    1.对象方法保存到类对象里面,每个类对象中都有一个方法列表.类方法保存在元类中方法列表 a.通过isa指针去对应的类中查找: b.生成方法编号,根据方法编号查找对应的方法(找到只是最终实现地址,根据地 ...

  10. 修改release management client对应的服务器的地址

    参考资料:http://stackoverflow.com/questions/25313053/how-to-change-a-release-management-server-name-in-r ...