Development

共370篇文章。

终于抓住了py-ldap中的内存泄漏!!

Development

之前曾经误认为Python中存在内存泄漏,不过最终证明还是C程序的问题。Py-LDAP2这个模块在某些情况下,会泄漏一个空的List,具体泄漏代码如下:

retval = Py_BuildValue("(OOiO)", result_str, pmsg, res_msgid, pyctrls ? pyctrls : PyList_New(0));

当pyctrls == NULL时,Py_BuildValue()会为PyList_New(0)生成的那个对象再增加一个引用,这样会导致泄漏。这一问题会发生于调用result()而all=0的情形。

阅读全文…:终于抓住了py-ldap中的内存泄漏!!(本文约210字,阅读大致需要1分钟)

My misunderstanding of OpenLDAP API

Development

I used to think that ldap_unbind() is the opposite of ldap_bind(),however I was wrong. Pierangelo Masarati (ando at openldap) pointed out that it was actually opposite of ldap_init(). So, do NOT expect init() -> bind() -> search() -> unbind() -> bind() would success, it’s simply wrong thing. You do not need to unbind() before you do another bind().

Just make a note.

参与评论:My misunderstanding of OpenLDAP API

FreeBSD src Makefile大手术

Development

Ruslan Ermilov大长辈commit了一组Makefile变动。这包含了许多来自NetBSD和FreeBSD ports的特性。

  • 新增了MK_*选项。这些选项是开发人员设置的,如果用户配置的话将发生错误。
  • 使用WITH_*和WITHOUT_*来控制是否build选项。
  • 某些选项提供了MK_*_SUPPORT子选项。
  • 系统选项可以在/etc/src.conf来配置。

感觉比之前要清晰许多。

参与评论:FreeBSD src Makefile大手术
搜索文章…(按ESC退出)