moving out outdated js docs
This commit is contained in:
25
olddocs/js/object-disclaimer.md
Normal file
25
olddocs/js/object-disclaimer.md
Normal file
@ -0,0 +1,25 @@
|
||||
# Objects disclaimer
|
||||
|
||||
Touch Develop docs for the micro:bit.
|
||||
|
||||
### Memory management on the micro-bit
|
||||
|
||||
New user-defined object types are allocated on the heap and are ref-counted. Our ref-counting algorithm does *not* have a cycle collector. (See Wikipedia.)
|
||||
|
||||
### Practical consequences
|
||||
|
||||
This means that the following script will result in an out-of-memory error.
|
||||
|
||||

|
||||
|
||||
```
|
||||
while (true) {
|
||||
let l = new List()
|
||||
l.next = l
|
||||
}
|
||||
```
|
||||
|
||||
### How to avoid this?
|
||||
|
||||
Don't do it. It's bad.
|
||||
|
Reference in New Issue
Block a user