Bug 1716147 - Mark TempAllocPolicy as JS_PUBLIC_API. r=sfink

Fix MSVC issues due to inconsistent JS_PUBLIC_API markers. The forward
definitions of TempAllocPolicy use JS_PUBLIC_API so the structure itself should
match.

Differential Revision: https://phabricator.services.mozilla.com/D117585
This commit is contained in:
Ted Campbell 2021-07-08 23:48:21 +00:00
Родитель 498eb65932
Коммит ca7e9e9e07
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -102,15 +102,15 @@ MOZ_COLD JS_PUBLIC_API void ReportOutOfMemory(JSContext* cx);
* FIXME bug 647103 - rewrite this in terms of temporary allocation functions, * FIXME bug 647103 - rewrite this in terms of temporary allocation functions,
* not the system ones. * not the system ones.
*/ */
class TempAllocPolicy : public AllocPolicyBase { class JS_PUBLIC_API TempAllocPolicy : public AllocPolicyBase {
JSContext* const cx_; JSContext* const cx_;
/* /*
* Non-inline helper to call JSRuntime::onOutOfMemory with minimal * Non-inline helper to call JSRuntime::onOutOfMemory with minimal
* code bloat. * code bloat.
*/ */
JS_PUBLIC_API void* onOutOfMemory(arena_id_t arenaId, AllocFunction allocFunc, void* onOutOfMemory(arena_id_t arenaId, AllocFunction allocFunc,
size_t nbytes, void* reallocPtr = nullptr); size_t nbytes, void* reallocPtr = nullptr);
template <typename T> template <typename T>
T* onOutOfMemoryTyped(arena_id_t arenaId, AllocFunction allocFunc, T* onOutOfMemoryTyped(arena_id_t arenaId, AllocFunction allocFunc,
@ -175,7 +175,7 @@ class TempAllocPolicy : public AllocPolicyBase {
js_free(p); js_free(p);
} }
JS_PUBLIC_API void reportAllocOverflow() const; void reportAllocOverflow() const;
bool checkSimulatedOOM() const { bool checkSimulatedOOM() const {
if (js::oom::ShouldFailWithOOM()) { if (js::oom::ShouldFailWithOOM()) {