.
This commit is contained in:
parent
5477252c23
commit
640519a5fa
1 changed files with 5 additions and 7 deletions
12
STYLEGUIDE
12
STYLEGUIDE
|
|
@ -134,10 +134,9 @@ Memory Management
|
|||
-----------------
|
||||
|
||||
If a custom type needs dynamically allocated memory to
|
||||
function, it should always assume the memory it requested
|
||||
came from an arena allocator. This means it is the
|
||||
responsibility of the arena to free the memory, not the
|
||||
custom data type.
|
||||
function, it should always assume the memory came from an
|
||||
arena allocator. This means it is the responsibility of
|
||||
the arena to free the memory, not the custom data type.
|
||||
|
||||
In other words:
|
||||
|
||||
|
|
@ -145,9 +144,8 @@ Do *not* add procedures that 'free' or 'delete' the memory
|
|||
allocated by the data type.
|
||||
|
||||
Instead, add procedures that 'reset' the data type,
|
||||
allowing the already allocated memory to be reused. For
|
||||
examples, see the 'reset' procedures in 'jc/kv'
|
||||
or 'jc/array'.
|
||||
allowing its memory to be reused. For examples, see
|
||||
the 'reset' procedures in 'jc/kv' or 'jc/array'.
|
||||
|
||||
|
||||
OS-Specific Code
|
||||
|
|
|
|||
Loading…
Reference in a new issue