Open Bug 730785 Opened 13 years ago Updated 2 years ago

make the ability, for embedders, to create uninitialized ArrayBuffer

Categories

(Core :: JavaScript Engine, enhancement)

x86_64
Windows 7
enhancement

Tracking

()

People

(Reporter: soubok, Unassigned)

References

Details

By default, the memory of an ArrayBuffer is initialized to zero (calloc_ in JSObject::allocateArrayBufferSlots).
It could be convenient to give embedders the ability to create uninitialized ArrayBuffers since data may be fill by the caller.
(In reply to Franck from comment #0)
> By default, the memory of an ArrayBuffer is initialized to zero (calloc_ in
> JSObject::allocateArrayBufferSlots).
> It could be convenient to give embedders the ability to create uninitialized
> ArrayBuffers since data may be fill by the caller.

We're in the process of adding APIs to allow the caller to pass in an array, and that array gets used to hold the contents. Would that work for what you are trying to do?
Allowing embedders to give initialized array to construct an ArrayBuffer is a good feature, this could avoid the double initialization.
But the best scenario would be to give embedders the ability to construct an ArrayBuffer with data allocated by the embedding (like JL_NewUCString for strings) see also Bug 691446.
OK, I'll try to work something like that into the transfer API work.
Depends on: 720949
Assignee: general → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.