driver_output_term() and unsigned long (32 bit) values

Sean Hinde <>
Fri Jul 26 21:39:42 CEST 2002

> > IMHO, I think it is a bad idea to allow a driver to create 
> a reference
> > since references should be unique and it will be hard to 
> guarantee    
> > uniqueness if there are several allocators ...              
> Why not a function:
> 	ErlDrvTerm driver_mkref()
> which will always use the internal reference allocator?  Or is it
> not possible to use the existing allocator underlying erlang:mkref/0
> while a driver is executing?

It might be a problem if this was called by a driver thread - depending on
the algorithm it might need some mutex protection. Calling something like
this from one of the main driver callbacks in the main thread shouldn't be a
problem though.


This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.

More information about the erlang-questions mailing list