-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathjetslammed.h
46 lines (38 loc) · 1.76 KB
/
jetslammed.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* jetslammed) - Ability to adjust jetsam memory limits for iOS tweaks
*
* From within the target process, use:
* jetslammed_updateWaterMark(350, "mytweakname");
*
* Default watermark levels are in /System/Library/LaunchDaemons/com.apple.jetsamproperties.<device id>.plist
* ie, com.apple.SpringBoard on iOS 8 for iPhone6 is JetsamMemoryLimit=240
*
* Copyright (C) 2014 @mariociabarra
*/
/* GNU Lesser General Public License, Version 3 {{{ */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
**/
/* }}} */
#define MAX_REQUEST_NAME 1024
#include <signal.h>
// Primary function
extern int jetslammed_updateWaterMark(int highWatermarkMB, char* requester);
// Helper functions if you want to use
extern int jetslammed_updateWaterMarkForPID(int highWatermarkMB, char* requester, int pid);
extern int getCurrentHighwatermark(int pid);
struct JetslammedRequest {
OSType magic; // must be kPacketMagic
int memorySize; // kPacketTypeGoodbye etc
char requestor[MAX_REQUEST_NAME]; // kPacketIDNone or some other value
pid_t pid; // includes size of header itself
};