Commit 8132347
authored
Throw exception on out of memory in dynamic buffer (#838)
js_dbuf_init users that check the return value of functions like
dbuf_put should be able to assume that an OOM exception is pending
when the function returns an error. No callers currently do so but
I am going to start doing that in the not too distant future.
js_dbuf_init takes a JSContext pointer, strongly suggesting it calls
js_realloc, but in fact it called js_realloc_rt, which does *not*
raise OOM exceptions.
Call js_realloc and move js_dbuf_realloc closer to js_dbuf_init for
legibility reasons.1 parent a0ea277 commit 8132347
1 file changed
+6
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1518 | 1518 | | |
1519 | 1519 | | |
1520 | 1520 | | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | 1521 | | |
1528 | 1522 | | |
1529 | 1523 | | |
| |||
1666 | 1660 | | |
1667 | 1661 | | |
1668 | 1662 | | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
1669 | 1668 | | |
1670 | 1669 | | |
1671 | | - | |
| 1670 | + | |
1672 | 1671 | | |
1673 | 1672 | | |
1674 | 1673 | | |
| |||
0 commit comments