On Sun, Jun 03, 2012 at 01:21:47PM +0100, Thomas Adam wrote:
The C standard dictates that calling free(NULL) is a no-op. So we can
safely assume this to be OK.
I'm a disaster. I forgot to include some files. Oops. Here's V2,
attached.
-- Thomas Adam
--
Deep in my heart I wish I was
Switch the callback of this command to use the centralised window_choose_ctx
function.
---
trunk/cmd-choose-session.c | 40 ++--
1 file changed, 6 insertions(+), 34 deletions(-)
diff --git a/trunk/cmd-choose-session.c b/trunk/cmd-choose-session.c
index
---
trunk/cmd-choose-buffer.c | 47 +
1 file changed, 22 insertions(+), 25 deletions(-)
diff --git a/trunk/cmd-choose-buffer.c b/trunk/cmd-choose-buffer.c
index 3e803f8..f55e565 100644
--- a/trunk/cmd-choose-buffer.c
+++ b/trunk/cmd-choose-buffer.c
Switch the callback of this command to use the centralised window_choose_ctx
function.
---
trunk/cmd-choose-window.c | 44 ++--
1 file changed, 6 insertions(+), 38 deletions(-)
diff --git a/trunk/cmd-choose-window.c b/trunk/cmd-choose-window.c
index
---
trunk/cmd-choose-window.c | 63 +++--
1 file changed, 32 insertions(+), 31 deletions(-)
diff --git a/trunk/cmd-choose-window.c b/trunk/cmd-choose-window.c
index 8ac0f0c..c4c 100644
--- a/trunk/cmd-choose-window.c
+++ b/trunk/cmd-choose-window.c
---
trunk/cmd-choose-session.c | 56 +++-
1 file changed, 29 insertions(+), 27 deletions(-)
diff --git a/trunk/cmd-choose-session.c b/trunk/cmd-choose-session.c
index 1a7fc12..8931141 100644
--- a/trunk/cmd-choose-session.c
+++
This patch series reworks the choose-mode internals to stop using a literal
u_int for identifying chosen elements to some data structure, and instead
returns a pointer to a struct.
Currently the choose-* commands are returned a u_int representing either a
window or session or some other index
---
trunk/cmd-find-window.c | 56 ++-
1 file changed, 26 insertions(+), 30 deletions(-)
diff --git a/trunk/cmd-find-window.c b/trunk/cmd-find-window.c
index ff8405f..88f84e7 100644
--- a/trunk/cmd-find-window.c
+++ b/trunk/cmd-find-window.c
@@ -30,8
Switch the callback of this command to use the centralised window_choose_ctx
function.
---
trunk/cmd-choose-buffer.c | 37 ++---
1 file changed, 6 insertions(+), 31 deletions(-)
diff --git a/trunk/cmd-choose-buffer.c b/trunk/cmd-choose-buffer.c
index
---
trunk/cmd-choose-client.c | 87 +
1 file changed, 32 insertions(+), 55 deletions(-)
diff --git a/trunk/cmd-choose-client.c b/trunk/cmd-choose-client.c
index 5ae882d..7ca4346 100644
--- a/trunk/cmd-choose-client.c
+++ b/trunk/cmd-choose-client.c
Hi,
On 3 June 2012 19:44, Nicholas Marriott nicholas.marri...@gmail.com wrote:
It isn't there to be defensive, free(NULL) of course is always
guaranteed to be safe. It's a deliberate aid to writing correct code,
you should know where your null pointers are. Whether it actually helps
or not is
There are 300-odd calls to xfree in tmux and it looks like only about 50
have a check. Those are the ones where we explicitly know that NULL is a
possibility. I don't think it adds much work to do this, I just don't
know if it actually helps to catch bugs or document anything.
On Sun, Jun 03,
Hi,
On 3 June 2012 20:19, Nicholas Marriott nicholas.marri...@gmail.com wrote:
There are 300-odd calls to xfree in tmux and it looks like only about 50
have a check. Those are the ones where we explicitly know that NULL is a
possibility. I don't think it adds much work to do this, I just don't
It forces you to think about the lifetime of what you are freeing rather
than just doing it. Remembering to add them in is not a problem, because
it is a fatal error if you forget... that's an easy bug to spot :-).
On Sun, Jun 03, 2012 at 08:23:46PM +0100, Thomas Adam wrote:
Hi,
On 3 June
Also it's handy to be able to instrument free without a lot of faffing
around (I used to have code to instrument it). Still, none of the
advantages are particularly compelling so I'm leaning towards making
this change, let me think about it...
On Sun, Jun 03, 2012 at 09:13:53PM +0100, Nicholas
15 matches
Mail list logo