Crashes when using in El Capitain
I have a macbook pro 15" 2011 i7 with a faulty GPU which has been disabled by software and power resistor removal.
Unlucky for me, I gave 3 faulty temperature sensors in the motherboard, which makes the system unusable when in stock. I could manage to use the computer by editing IOPlatformPluginFamily.kext by entering safe mode and changing one of inside files.
Failures are at these sensors: Airport , Heatpipe 2 and Heatpipe Out. https://imgur.com/a/4eKvHzv
I cant update the system to High Sierra because it will fuck up sleep and brightness control because of the GPU deactivation. I Tried to compile CPUTune, but it shows some files are missing as shows the image: https://imgur.com/a/6349Xw7
Loading the 2.1.7 crashes the system and trying to load 2.1.5 version without NVRAM shows the following error: https://imgur.com/a/3hciXLS
Using NoBatteryNoProblem.kext works but puts the system at max power and fans go wild, I dont think it is a sustainable way of working.
Any thoughts?
Thanks, I will try to remove the stddef.h for your case and upload a newer version.
Thanks, also an update. NoBatteryNoProblem.kext is now working fine. The reason that the system was at maximum power and fans wild was because of idlehalt=0 flag at startup arguments.
However this kext don't load at startup and also after sleep.
I tried some older versions like 1.90 and 1.85 of CPUTune without any success. It seems that something is missing in El Capitain to run it accordingly.
Cheers.
Update:
Version 2.2.1 can compile at High Sierra and don't crash when runt in El Cap. I think we can close the issue with the .kext file.
Thank you very much for the support.
EDIT: Nope, crashes are back. Shutdown cause : -62
Additionally the computer cant wake from sleep. Trying to figure out the reason.
Hmm, let's check what cause the issue after wake from sleep
@rnt0 In the meantime, could you please give v2.2.3 a try which attempt to fix the memory leak in your case. Thanks in advance!
I got a compilation error of divergent types between two declarations of kern_os_free, so I watched the code, and noticed that it requires only one argument so I commented the first function declaration.

Now i'm getting a second compile error which I can't identify the issue:

@rnt0 Thanks for pointing out! Feel free to give the latest version a try which should fix the compilation issue.
Added two semicolons at Kern_util.cpp at lines 96 and 100 and it compiles perfectly.
Remaining issues:
- Computer can't wake from sleep
- Frequency locks at maximum core speed (Still don't know why), tried to enable/disable turbo boost and frequency switching without success
Testing if random shutdowns still happen.
@rnt0 thanks for pointing out, added back the semicolon in v2.2.5!