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 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20070707/c76f42d6/attachment.html>
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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/dtrace-discuss/attachments/20070708/f1f969d6/attachment.html>
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