ltable.h(5.3.4)解析

/*
** $Id: ltable.h,v 2.23 2016/12/22 13:08:50 roberto Exp $
** Lua tables (hash)
** See Copyright Notice in lua.h
*/

#ifndef ltable_h
#define ltable_h

#include "lobject.h"




// 此处的t就是table的实体对象
// gnode用来返回t的哈希部分的第i个节点,此处的i就是哈希部分0-size-1的整数值

// 此处的n是table的哈希部分的一个节点
// gval用来返回节点中的值(是一个TValue类型)

// gnext用来返回此节点的下一个节点的地址(其实是一个偏移)
#define gnode(t,i)	(&(t)->node[i])
#define gval(n)		(&(n)->i_val)
#define gnext(n)	((n)->i_key.nk.next)


/* 'const' to avoid wrong writings that can mess up field 'next' */

// 返回n的键里面的tvk的指针
#define gkey(n)		cast(const TValue*, (&(n)->i_key.tvk))

/*
** writable version of 'gkey'; allows updates to individual fields,
** but not to the whole (which has incompatible type)
*/
// wgkey是对gkey的可写版本,允许对单个字段进行更新
// 但不能整体更新
#define wgkey(n)		(&(n)->i_key.nk)

// 清空table的元表
#define invalidateTMcache(t)	((t)->flags = 0)


/* true when 't' is using 'dummynode' as its hash part */
// 如果lastfree为NULL,说明这个table没有哈希部分(其实哈希部分的size为0,里面只有一个虚拟节点,定义在ltable.c中)
#define isdummy(t)		((t)->lastfree == NULL)


/* allocated size for hash nodes */
// 返回以2为底的散列表大小的对数值
#define allocsizenode(t)	(isdummy(t) ? 0 : sizenode(t))


/* returns the key, given the value of a table entry */
// offsetof用于求结构体中一个成员在该结构体中的偏移量
#define keyfromval(v) \
  (gkey(cast(Node *, cast(char *, (v)) - offsetof(Node, i_val))))


// 返回key对应的i字段
LUAI_FUNC const TValue *luaH_getint (Table *t, lua_Integer key);

// 把t中key的value设置为传进来的value
LUAI_FUNC void luaH_setint (lua_State *L, Table *t, lua_Integer key,
                                                    TValue *value);
// 返回key对应的tsv字段
LUAI_FUNC const TValue *luaH_getshortstr (Table *t, TString *key);
LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key);

// 获取key对应的具体的值
LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key);

// 在t中插入一个新的key,可能会重新哈希
LUAI_FUNC TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key);

// 如果传进来的key已经存在于t中,那么直接返回key对应的索引,不然就新建一个key
LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key);
// 在L里创建一张空表
LUAI_FUNC Table *luaH_new (lua_State *L);
// 重新设置t的数组部分和哈希部分的size并且做初始化
LUAI_FUNC void luaH_resize (lua_State *L, Table *t, unsigned int nasize,
                                                    unsigned int nhsize);
// 重新调整数组部分大小
LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, unsigned int nasize);
// 释放table的内存
LUAI_FUNC void luaH_free (lua_State *L, Table *t);
// 实现table的递归。通过上一个键,来找到下一个键值对。
LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key);
// 获取有效t的长度(废弃)
LUAI_FUNC int luaH_getn (Table *t);


#if defined(LUA_DEBUG)
// 返回key对应的mp位置
LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key);
// 判断t中的哈希部分是否存在
LUAI_FUNC int luaH_isdummy (const Table *t);
#endif


#endif

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
org.springframework.security.authentication.InternalAuthenticationServiceException: null at org.springframework.security.authentication.dao.DaoAuthenticationProvider.retrieveUser(DaoAuthenticationProvider.java:123) ~[spring-security-core-5.3.4.RELEASE.jar:5.3.4.RELEASE] at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:144) ~[spring-security-core-5.3.4.RELEASE.jar:5.3.4.RELEASE] at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:199) ~[spring-security-core-5.3.4.RELEASE.jar:5.3.4.RELEASE] at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:95) ~[spring-security-web-5.3.4.RELEASE.jar:5.3.4.RELEASE] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212) ~[spring-security-web-5.3.4.RELEASE.jar:5.3.4.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.3.4.RELEASE.jar:5.3.4.RELEASE] at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) [spring-security-web-5.3.4.RELEASE.jar:5.3.4.RELEASE] at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) [spring-security-web-5.3.4.RELEASE.jar:5.3.4.RELEASE] at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92) [spring-security-web-5.3.4.RELEASE.jar:5.3.4.RELEASE] at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77) [spring-security-web-5.3.4.RELEASE.jar:5.3.4.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) [spring-web-5.2.9.RELEASE.jar:5.2.9.
07-20

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值