From f7af5e52d7ada47a38d309aea76e166be27f6288 Mon Sep 17 00:00:00 2001
From: Steve Vinoski
Resource types support upgrade in runtime by allowing a loaded NIF - library to takeover an already existing resource type and thereby - "inherit" all existing objects of that type. The destructor of the new - library will thereafter be called for the inherited objects and the - library with the old destructor function can be safely unloaded. Existing - resource objects, of a module that is upgraded, must either be deleted - or taken over by the new NIF library. The unloading of a library will be - postponed as long as there exist resource objects with a destructor - function in the library. -
-Here is a template example of how to create and return a resource object.
+Here is a template example of how to create and return a resource object.
ERL_NIF_TERM term;
@@ -240,8 +230,13 @@ ok
/* resource now only owned by "Erlang" */
}
return term;
-}
-
+
+ Note that once
Another usage of resource objects is to create binary terms with
user defined memory management.
Resource types support upgrade in runtime by allowing a loaded NIF + library to takeover an already existing resource type and thereby + "inherit" all existing objects of that type. The destructor of the new + library will thereafter be called for the inherited objects and the + library with the old destructor function can be safely unloaded. Existing + resource objects, of a module that is upgraded, must either be deleted + or taken over by the new NIF library. The unloading of a library will be + postponed as long as there exist resource objects with a destructor + function in the library. +
A NIF is thread-safe without any explicit synchronization as @@ -368,7 +373,7 @@ ok environments between NIF calls.
A process independent environment is created by calling
Create an opaque handle to a memory managed resource object
obtained by
Note that the only defined behaviour of using a resource term in
an Erlang program is to store it and send it between processes on the
same node. Other operations such as matching or This document describes the changes made to the ERTS application.
+ The scroll wheel now scrolls the werl window on Windows.
+ Own Id: OTP-8985
+ Some malformed distribution messages could cause VM to
+ crash, this is now corrected.
+ Own Id: OTP-8993
+ The OS function getifaddrs() can return NULL in some
+ address fields for e.g PPP and tunnel devices which
+ caused the emulator to segfault. This bug has now been
+ corrected.
+ Own Id: OTP-8996
+ The expression <<A:0>> would always produce
+ an empty binary, even if
+ Own Id: OTP-8997
+ A bug that potentially could cause an emulator crash when
+ deleting an ETS-table has been fixed. A resource leak
+ when hitting the maximum amount of ETS-tables allowed has
+ also been fixed.
+ Own Id: OTP-8999
+ A bug in the
+ Own Id: OTP-9005
+ Due to a bug in glibc the runtime system could abort
+ while trying to destroy a mutex. The runtime system will
+ now issue a warning instead of aborting.
+ Own Id: OTP-9009
+ A bug in epmd could create strange behaviour when
+ listen() calls failed. This is now corrected thanks to
+ Steve Vinoski.
+ Own Id: OTP-9024 When setting file_info the win32_driver will now
+ correctly set access and modified time. Previously these
+ entities were swapped.
+ Own Id: OTP-9046
+ Setting scheduler bind type to
+ Own Id: OTP-9056 Aux Id: Seq11779 Two problems were fixed in crash dump: The time left
+ for timers are now shown as unsigned integers and the
+ contents of ordered_set ETS tables is no longer
+ included.
+ Own Id: OTP-9057
+ The VM could fail to set IP_TOS and SO_PRIORITY in
+ certain situations, either because sockets were supplied
+ as open file descriptors, or because SO_PRIORITY by
+ default was set higher than the user can explicitly set
+ it to. Those situations are now handled.
+ Own Id: OTP-9069
+ Wx on MacOS X generated complains on stderr about certain
+ cocoa functions not beeing called from the "Main thread".
+ This is now corrected.
+ Own Id: OTP-9081
+ Fix a couple typos in driver_entry(3) (thanks to Tuncer
+ Ayaz).
+ Own Id: OTP-9085
+ Mention that "-detached" implies "-noinput"
+ Clarify that specifying "-noinput" is unnecessary if the
+ "-detached" flag is given. (thanks to Holger Weiß)
+ Own Id: OTP-9086
+ A potential problem (found by code inspection) when
+ calling a fun whose code was not loaded has been fixed.
+ Own Id: OTP-9095
+ The emulator could get into a state where it didn't check
+ for I/O.
+ Own Id: OTP-9105 Aux Id: Seq11798
+ Attempting to create binaries exceeding 2Gb (using for
+ example
+ Own Id: OTP-9117
+ Fix erlang:hibernate/3 on HiPE enabled emulator (Thanks
+ to Paul Guyot)
+ Own Id: OTP-9125 From this release, the previously experimental
+ halfword emulator is now official. It can be enabled by
+ giving the The halfword emulator is a 64-bit application, but
+ uses halfwords (32-bit words) for all data in Erlang
+ processes, therefore using less memory and being faster
+ than the standard 64-bit emulator. The total size of all
+ BEAM code and all process data for all processes is
+ limited to 4Gb, but ETS tables and off-heap binaries are
+ only limited by the amount of available memory.
+ Own Id: OTP-8941
+ 32-bit atomic memory operations have been introduced
+ internally in the run time system, and are now used where
+ appropriate. There were previously only atomic memory
+ operations of word size available. The 32-bit atomic
+ memory operations slightly reduce memory consumption, and
+ slightly improve performance on 64-bit runtime systems.
+ Own Id: OTP-8974
+ Performance enhancements for looking up timer-entries and
+ removing timers from the wheel.
+ Own Id: OTP-8990
+ Write accesses to ETS tables have been optimized by
+ reducing the amount of atomic memory operations needed
+ during a write access.
+ Own Id: OTP-9000
+ Strange C coding in the VM made the -D_FORTIFY_SOURCE
+ option to gcc-4.5 react badly. The code is now cleaned up
+ so that it's accepted by gcc-4.5.
+ Own Id: OTP-9025
+ The memory footprint for loaded code has been somewhat
+ reduced (especially in the 64-bit BEAM machine).
+ Own Id: OTP-9030
+ The maximum number of allowed arguments for an Erlang
+ function has been lowered from 256 to 255, so that the
+ number of arguments can now fit in a byte.
+ Own Id: OTP-9049
+ Dependency generation for Makefiles has been added to the
+ compiler and erlc. See the manual pages for
+
+ Own Id: OTP-9065
+
+
+
+