This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
RE: Inconsistent behavior of 'delete'
- From: "Stone, Joshua I" <joshua dot i dot stone at intel dot com>
- To: "Martin Hunt" <hunt at redhat dot com>
- Cc: <systemtap at sources dot redhat dot com>
- Date: Fri, 6 Jan 2006 15:04:09 -0800
- Subject: RE: Inconsistent behavior of 'delete'
Martin Hunt wrote:
> Not working for pmaps is certainly a bug. It also needs to work for
> stats. The rest is debatable, but probably desirable for consistency.
Agreed. It also doesn't work for maps with string values, which is
definitely a bug.
> Should we consider changing the name to "clear" instead of "delete"?
> For maps, delete actually deletes entries, freeing up memory. However,
> that doesn't apply to other types.
As long as it's one or the other - I don't think "clear" and "delete"
should coexist.
From the user perspective, I think "clear" might be more meaningful.
One can read from uninitialized or deleted map indices and get a 0 or ""
as if it were cleared. But the language has no concept of memory
management, so "delete" is really meaningless. Manually clearing an
entry (e.g. assigning 0 or "") will also free memory, so that
distinction doesn't matter to the user.
Josh