Check-in [b28cd71459]

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Rebase TIP 506 to apply to Tcl 8.7.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b28cd7145949729c1029b8f32043d3ba730aa60231ef35099301d732124b90e3
User & Date: dgp 2018-10-27 01:13:33
Context
2018-10-27
01:15
Mark TIP 522 as voting. check-in: a90889105b user: dgp tags: trunk
01:13
Rebase TIP 506 to apply to Tcl 8.7. check-in: b28cd71459 user: dgp tags: trunk
2018-10-26
21:07
Started on discussion in 523 check-in: 9a80a7b5f2 user: pspjuth tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tip/506.md.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
..
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# TIP 506: Purge RefCount Macros
	Author:         Don Porter <[email protected]>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        30-Mar-2018
	Post-History:   
	Tcl-Version:	9.0
	Tcl-Branch:     tip-506
-----

# Abstract

Stop having all extensions and applications use macros to access the
**refCount** field of the **Tcl_Obj** struct.
................................................................................

# Background

In all of recorded Tcl development history (since version 8.0p2 in 1998),
the "routines" **Tcl_IncrRefCount**, **Tcl_DecrRefCount**, and
**Tcl_IsShared** have been defined as macros, built on top of the
premise that the caller has direct access to the **objPtr->refCount**
field and the **TclFreeProc** routine, which is in public stubs even
though it has a name suggesting a private routine and users of the Tcl
C interface are instructed not to call it other than through the
**Tcl_DecrRefCount** macro.

Like all encapsulation-breaking, the effect is to more strongly
couple together modules of code so that they are inhibited
from freely evolving as independently as they otherwise could.
................................................................................
are a chance to consider the actual merit of those claims beyond keeping
up a cargo cult habit.

# Proposal

Remove the macros **Tcl_IncrRefCount**, **Tcl_DecrRefCount**, and
**Tcl_IsShared** from the **tcl.h** file. Create routines in the
public stub table to replace them. Remove **TclFreeObj** from the
public stub table.

# Compatibility

This is a hard binary incompatibility. It is properly proposed
as a change for Tcl 9, where all extensions and applications will
require a re-compile anyway.

# Implementation

On the tip-506 branch.

# Copyright

This document has been placed in the public domain.







|







 







|







 







|
|



|
|
|









1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
..
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
..
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# TIP 506: Purge RefCount Macros
	Author:         Don Porter <[email protected]>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        30-Mar-2018
	Post-History:   
	Tcl-Version:	8.7
	Tcl-Branch:     tip-506
-----

# Abstract

Stop having all extensions and applications use macros to access the
**refCount** field of the **Tcl_Obj** struct.
................................................................................

# Background

In all of recorded Tcl development history (since version 8.0p2 in 1998),
the "routines" **Tcl_IncrRefCount**, **Tcl_DecrRefCount**, and
**Tcl_IsShared** have been defined as macros, built on top of the
premise that the caller has direct access to the **objPtr->refCount**
field and the **TclFreeObj** routine, which is in public stubs even
though it has a name suggesting a private routine and users of the Tcl
C interface are instructed not to call it other than through the
**Tcl_DecrRefCount** macro.

Like all encapsulation-breaking, the effect is to more strongly
couple together modules of code so that they are inhibited
from freely evolving as independently as they otherwise could.
................................................................................
are a chance to consider the actual merit of those claims beyond keeping
up a cargo cult habit.

# Proposal

Remove the macros **Tcl_IncrRefCount**, **Tcl_DecrRefCount**, and
**Tcl_IsShared** from the **tcl.h** file. Create routines in the
public stub table to replace them. Mark **TclFreeObj** as deprecated
in the public stub table, and remove it from the Tcl 9 branch.

# Compatibility

The removal of **TclFreeObj** is is a hard binary incompatibility.
It is properly proposed as a change for Tcl 9, where all extensions
and applications will require a re-compile anyway.

# Implementation

On the tip-506 branch.

# Copyright

This document has been placed in the public domain.