Artifacts Associated With Ticket 218924
Ticket change [595ab49951] (rid 117965) by nobody on 2000-10-26 01:07:57:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 2795 Bug Version: 8.2 SubmitDate: '1999-09-16' LastModified: '1999-09-18' Severity: MED Status: Released Submitter: techsupp ChangedBy: hobbs RelatedBugIDs: 2518 OS: AIX OSVersion: 4.3.2 Machine: RS6000 FixedDate: '1999-09-18' FixedInVersion: 8.2.1 ClosedDate: '2000-10-25' Name: Nick Kisseberth Comments: Tcl_Alloc(0) should either always return NULL when asked for 0 bytes or should always return a unique pointer. It shouldn't maintain the "implementation defined" definition ANSI gives malloc(0). So for AIX it could just convert a request for 0 bytes to a request for 1 byte. I prefer Tcl_Alloc(0) to return NULL, but I suspect I'll be in the minority. ObservedBehavior: Tcl doesn't like malloc(0) returning NULL. This is valid ANSI C behavior (malloc(0) is implementation defined, must return NULL or unique pointer). Tcl_Alloc will panic because of this. DesiredBehavior: malloc(0)==NULL should be permitted Patch: *** tcl8.2.0/generic/tclCkalloc.c Tue Aug 10 11:09:45 1999 --- tcl8.2.0-AIX/generic/tclCkalloc.c Thu Sep 9 11:46:12 1999 *************** *** 799,805 **** char *result; result = TclpAlloc(size); ! if (result == NULL) panic("unable to alloc %d bytes", size); return result; } --- 799,805 ---- char *result; result = TclpAlloc(size); ! if ((result == NULL) && (size != 0)) panic("unable to alloc %d bytes", size); return result; } PatchFiles: generic/tclCkalloc.c A more complete patch in the above style is included for 8.2.1. -- 09/18/1999 hobbs - foundin initialized to: "obsolete: 8.2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "malloc(0) == NULL on AIX is not an error"
- type initialized to: "Bug"
Ticket change [6a985fe54f] (rid 128182) by welch on 2000-10-26 08:31:17:
- closedate changed to: "2000-10-26T01:31:17"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [01fcf4fcbe] (rid 119573) by dgp on 2001-04-19 03:24:06:
- closedate changed to: "2001-04-18T20:24:06"
- closer changed to: "dgp"
- subsystem changed to: "41. Memory Allocation"