This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]