Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #1967 (new defect)

Opened 14 years ago

Last modified 14 years ago

NO_SCAN flags in Conduit.load and File.get

Reported by: fawzi Assigned to: kris
Priority: major Milestone: 1.0
Component: Tango Version: 0.99.9 Kai
Keywords: Cc:

Description

We had already discussed about the use of void[] vs. ubyte[], but discussing with Steven Schveighoffer on druntime I realized that Conduit.load and File.get are wrong, as they might use void[] attributes and thus not set NO_SCAN. I feel that their return type shoult be changed to a ubyte[] or a template parameter, but at the minimum an ubyte[] arrays should be used internally for the first allocation (always in load, only if no array is passed in get).

Attachments

no_scan.patch (1.6 kB) - added by mwarning on 08/30/10 21:12:54.

Change History

08/24/10 04:05:23 changed by kris

just out of interest, why is NO_SCAN set on a byte[] but not a void[]?

08/24/10 06:01:50 changed by fawzi

because ubyte is known not to contain pointers, whereas void[] might (at least that is the rationale). Want to change void[] properties?

08/30/10 21:12:54 changed by mwarning

  • attachment no_scan.patch added.

08/30/10 21:19:32 changed by mwarning

The patch shows all(?) of the suggested changes. It would be nicer to change the dst argument to ubyte[] (or byte[]) as well. But this would break the api.

10/23/10 14:29:53 changed by llucax

I think something has to be done, probably ubyte[] is the right choice, but if you don't want to change the API, at least NO_SCAN should be set in the memory allocated.

10/24/10 00:35:12 changed by mwarning

these void[] => ubyte[] changes would propagate through the whole Conduit code if we don't do any casting. Is it smth. we should do?