[dtrace-discuss] a piece of dtrace source code

Adam Leventhal ahl at eng.sun.com
Mon Jul 9 09:54:21 PDT 2007


Nice find, but the fix is just to remove the spurious - 1. If you haven't
already, please file a bug.

Adam

On Sun, Jul 08, 2007 at 02:28:15AM +0800, ???? Tao Jie wrote:
> err... I think this should be a bug.  the correct code is
> sizeof (dt_proc_t *) * *(*_dtrace_pidbuckets *- 1)*, isn't it?
> 
> 
> 2007/7/7, ÌÕ½Ý Tao Jie <eulertao at gmail.com>:
> >
> >Dear all:
> >
> >in file dt_proc.c
> >
> >void
> >dt_proc_hash_create(dtrace_hdl_t *dtp)
> >{
> > if ((dtp->dt_procs = dt_zalloc(dtp, sizeof (dt_proc_hash_t) +
> >     sizeof (dt_proc_t *) * _dtrace_pidbuckets *- 1*)) != NULL) {
> >......
> >......
> >......
> >
> >
> >Why does the size minus one? I have no idea about this :(
> >
> >
> >
> >Regards
> >TJ
> >

> _______________________________________________
> dtrace-discuss mailing list
> dtrace-discuss at opensolaris.org

-- 
Adam Leventhal, Solaris Kernel Development       http://blogs.sun.com/ahl


More information about the dtrace-discuss mailing list