Skip to content

Commit

Permalink
Delete RCTConstants.RCTGetMemoryPressureUnloadLevel (#47297)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #47297

In this diff I'm proposing to remove configuration for RCTConstants.RCTGetMemoryPressureUnloadLevel API in iOS

changelog: [iOS][Breaking] Delete experimental API RCTConstants.RCTGetMemoryPressureUnloadLevel

Reviewed By: rubennorte, philIip

Differential Revision: D65181556

fbshipit-source-id: c435bec6ed03562b53f1924add7b69ab517b190b
  • Loading branch information
mdvacca authored and facebook-github-bot committed Oct 30, 2024
1 parent 8bd1f3f commit d79dc48
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
6 changes: 0 additions & 6 deletions packages/react-native/React/Base/RCTConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,3 @@ RCT_EXTERN NSString *const RCTDidInitializeModuleNotification;
*/
RCT_EXTERN BOOL RCTGetDispatchW3CPointerEvents(void);
RCT_EXTERN void RCTSetDispatchW3CPointerEvents(BOOL value);

/*
* Memory Pressure Unloading Level
*/
RCT_EXTERN int RCTGetMemoryPressureUnloadLevel(void);
RCT_EXTERN void RCTSetMemoryPressureUnloadLevel(int value);
16 changes: 0 additions & 16 deletions packages/react-native/React/Base/RCTConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,3 @@ void RCTSetDispatchW3CPointerEvents(BOOL value)
{
RCTDispatchW3CPointerEvents = value;
}

/*
* Memory Pressure Unloading Level for experimentation only.
* Default is 15, which is TRIM_MEMORY_RUNNING_CRITICAL.
*/
static int RCTMemoryPressureUnloadLevel = 15;

int RCTGetMemoryPressureUnloadLevel(void)
{
return RCTMemoryPressureUnloadLevel;
}

void RCTSetMemoryPressureUnloadLevel(int value)
{
RCTMemoryPressureUnloadLevel = value;
}
3 changes: 2 additions & 1 deletion packages/react-native/React/CxxBridge/RCTCxxBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ - (void)handleMemoryWarning
// in case if some other tread resets it.
auto reactInstance = _reactInstance;
if (reactInstance) {
int unloadLevel = RCTGetMemoryPressureUnloadLevel();
// Memory Pressure Unloading Level 15 represents TRIM_MEMORY_RUNNING_CRITICAL.
int unloadLevel = 15;
reactInstance->handleMemoryPressure(unloadLevel);
}
}
Expand Down

0 comments on commit d79dc48

Please sign in to comment.